Back to API docs

Test mode for SDK instrumentation

Test mode marks SDK events with isTestMode: true so teams can validate instrumentation before releasing it to real users. Use it when adding the SDK, changing an event taxonomy, testing a new paywall, or verifying a revenue-provider integration. Test events should appear in live debugging and setup flows without being treated as production traffic.

Enable test mode in the SDK

Turn test mode on in local builds, TestFlight, internal app sharing, or development flavors. Keep the production ingest URL and use a test ingest key when possible, so delivery behavior matches production while the data remains clearly separated.

Code
// SwiftAppMetricsConfiguration(  ingestURL: url,  ingestKey: key,  testMode: true)
// KotlinAppMetricsConfig(  ingestUrl = url,  ingestKey = key,  testMode = true)

What test mode changes

Manual ingest check

If an SDK integration is hard to debug, send a single test event with curl. This separates server connectivity from app lifecycle code. After the request succeeds, open Live Events and confirm that App.launch appears with the test-mode filter enabled.

Code
curl -X POST https://appmetricskit.com/api/ingest \  -H "Authorization: Bearer amk_test_..." \  -H "Content-Type: application/json" \  -d '{    "events": [{      "eventName": "App.launch",      "eventId": "local-test-1",      "isTestMode": true,      "payload": { "source": "local-debug" }    }]  }'

Release checklist

  1. Install the iOS or Android SDK and configure a test ingest key.
  2. Send App.launch, one onboarding event, one paywall event, and one purchase test event.
  3. Open Live Events and confirm that event names, payload keys, platform, app version, and test-mode status look correct.
  4. Open the privacy audit and fix any risky payload keys before shipping.
  5. Switch to the live ingest key and set testMode: false only for production release builds.