CMS SDK

Error monitoring for WordPress

A drop-in plugin that captures PHP fatals and notices. Configure it with two constants in `wp-config.php`, or through the plugin's settings screen.

Frameworks WordPressRequires PHP 8.1+Package errorgap (plugin)Source ↗Agent guide ↗
Install

Install

Upload and activate the Errorgap plugin — via WordPress admin → Plugins → Add New → Upload, or by placing it in wp-content/plugins/ and activating it. With WP-CLI:

sh
wp plugin activate errorgap
Configure

Configure

Add these to wp-config.php, above the /* That's all, stop editing! */ line:

php
define('ERRORGAP_API_KEY', getenv('ERRORGAP_API_KEY'));
define('ERRORGAP_ENDPOINT', getenv('ERRORGAP_ENDPOINT'));

Set the environment variables in your hosting environment. If env vars aren't available, enter the values in the plugin's settings screen instead — don't commit wp-config.php with a hardcoded key.

Trigger a test error

Trigger a test error

From WP-CLI:

sh
wp eval 'throw new \Exception("Errorgap test error");'

Or temporarily add throw new \Exception('Errorgap test error'); to a theme's functions.php, load any page, then remove it.

Verify

Verify the connection

Confirm your key and endpoint reach errorgap before wiring anything else — send one event straight to the ingestion API:

bash
curl -sS -X POST "$ERRORGAP_ENDPOINT/api/projects/$ERRORGAP_PROJECT_SLUG/notices" \
  -H "content-type: application/json" \
  -H "x-errorgap-project-key: $ERRORGAP_API_KEY" \
  -d '{"errors":[{"type":"ErrorgapInstallTest","message":"Errorgap install verification"}]}'

A 201 with a group_id means ingestion works (202 = received but sampled; 401 = wrong key). Then trigger the test error above through the SDK. Your onboarding screen's Verify step checks the stack off automatically once the first event lands — it polls every three seconds.

Next: the full ingestion API, or browse every SDK.