zaengle / craft-phonehome
Phone Home plugin for Craft CMS
Package info
github.com/zaengle/craft-phonehome
Type:craft-plugin
pkg:composer/zaengle/craft-phonehome
Requires
- php: >=8.1
- craftcms/cms: ^4.0.0||^5.0.0
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/phpstan: dev-main
- mockery/mockery: ^1.5
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-develop
- 2.0.0
- 1.9.0
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- dev-main
- dev-release/2.0.0
- dev-chore/remove-unused-workflows
- dev-feature/2.0-slim-report
- dev-chore/export-ignore-and-stale-workflows
- dev-feature/failed-token-attempts
- dev-feature/drop-phpinfo-widen-redaction
- dev-fix/token-env-reference-only
- dev-fix/match-craft-404
- dev-fix/runner-user-agent
- dev-feature/cf-access-service-token
- dev-feature/project-config-schema
- dev-fix/git-above-craft-root
- dev-sync/main-into-develop
- dev-fix/pr-body-patch-link
- dev-feature/deploy-revision
- dev-fix/narrow-composer-update
- dev-feature/verification-manifest-poc
- dev-fix/remediation-pilot-findings
- dev-fix/verification-review-findings
- dev-feature/ci-test-runner
- dev-feature/npm-package-reporting
- dev-dev-craft-6
- dev-feature/16-status-checks
- dev-fix/warning-on-app-config-aray-access
This package is auto-updated.
Last update: 2026-12-02 03:16:10 UTC
README
Monitor the status of your #CraftCMS projects remotely
Phonehome a secure API endpoint that returns comprehensive information about a Craft CMS installation and the server environment it is installed in.
Requirements
This plugin requires Craft CMS 4.0.0+ or 5.0.0+, and PHP 8.1+.
Quickstart Installation
composer require zaengle/craft-phonehome ./craft plugin/install phonehome
then in config/phonehome.php add:
return [ // Your secure token from the Zaengle Phone Home service. Keep the single quotes: the value is // the name of the environment variable, which the plugin resolves when it checks a request. 'token' => '$PHONEHOME_TOKEN', ];
Use a random token of at least 32 characters, for example the output of openssl rand -hex 32. A shorter token is refused, and the site rejects every request until the token is replaced.
The plugin's settings page also accepts the token, but only as an environment variable reference such as $PHONEHOME_TOKEN, so that the token is kept out of project config.
Documentation
See the full documentation in the docs/ directory of this repository.
What the API Reports
By default, the API returns only the fields the Phone Home dashboard uses: the PHP, Craft and database versions, the operating system, plugins, modules, available updates, npm dependencies, status checks, the deployed revision and the verification manifest. A site can opt in to the full report, which adds the meta section and the rest of system, by setting fullReport in config/phonehome.php. The full report is meant as a troubleshooting aid, and it can only be turned on from the config file:
return [ 'token' => '$PHONEHOME_TOKEN', 'fullReport' => true, ];
See the API documentation for the exact fields in each report.
API Schema
The plugin provides a JSON schema that defines the structure of the API response. The schema is located at src/schemas/PhonehomeApi.schema.json and follows semantic versioning.
You can retrieve the schema via the API endpoint:
GET /actions/phonehome/api/schema
X-Auth-Token: your-token-here
Important for contributors: When modifying the API response structure in Report::getInfo(), you must update the schema file accordingly and bump the schema version following semantic versioning rules. See CLAUDE.md for detailed schema maintenance guidelines.
Configuration
Additional Environment Variables
When the full report is turned on, you can include additional environment variables in the API response by setting additionalEnvKeys in your config/phonehome.php. This setting is read only from the config file, never from the control panel:
return [ 'token' => '$PHONEHOME_TOKEN', 'fullReport' => true, 'additionalEnvKeys' => [ 'MY_CUSTOM_ENV_VAR', 'DEPLOYMENT_ID', 'BUILD_NUMBER', ], ];
These values are included in the meta section of the API response. Only the full report carries meta, so this setting has no effect unless fullReport is also true. A value whose name looks sensitive is masked, and credentials are stripped from URL values.
Extensibility
Custom Status Checks
You can register custom status checks to monitor application-specific health metrics. Status checks are registered via Craft's event system:
use yii\base\Event; use zaengle\phonehome\services\Report; use zaengle\phonehome\events\RegisterStatusChecksEvent; Event::on( Report::class, Report::EVENT_REGISTER_STATUS_CHECKS, function(RegisterStatusChecksEvent $event) { $event->checks[] = MyCustomStatusCheck::class; } );
Your status check class must implement StatusCheckInterface:
use zaengle\phonehome\statuschecks\StatusCheckInterface; use zaengle\phonehome\models\StatusCheckResult; use zaengle\phonehome\enums\StatusCheck; class MyCustomStatusCheck implements StatusCheckInterface { public static function getName(): string { return 'My Custom Check'; } public static function getDescription(): string { return 'Monitors custom application metrics'; } public static function check(): StatusCheckResult { return new StatusCheckResult([ 'name' => self::getName(), 'status' => StatusCheck::OK, 'description' => self::getDescription(), 'meta' => [ 'custom_metric' => 'value', ], ]); } }
Support
For support, visit the GitHub repository.
Development
See the development guide for details on how to contribute to this project.