Testing
AppDNA provides a fully isolated sandbox environment for testing your SDK integration before going to production. Sandbox and production environments are completely separate — different API endpoints, different API keys, different data stores.Sandbox vs Production
| Sandbox | Production | |
|---|---|---|
| API endpoint | https://sandbox-api.appdna.ai | https://api.appdna.ai |
| Key prefix | adn_test_ | adn_live_ |
| Data | Isolated, periodically purged | Permanent, production analytics |
| Webhooks | Fully functional, isolated | Fully functional |
| Experiments | Independent from production | Independent from sandbox |
| Rate limits | Same as production | Standard limits |
Setup
Create a sandbox API key
Go to Console > Settings > SDK > API Keys and click Create Key. Select the Sandbox environment. The generated key will have the
adn_test_ prefix.Configure the SDK with the sandbox key
Pass the sandbox key to
AppDNA.configure(). The SDK automatically routes all requests to the sandbox API based on the key prefix.SDK Configuration for Sandbox
- iOS
- Android
- Flutter
- React Native
Setting
logLevel to debug during testing enables verbose SDK console output. You will see every event being queued, every config fetch, and every experiment assignment logged to the console.Event Debugger
The Event Debugger is a real-time event viewer in the AppDNA Console that lets you verify your SDK integration is working correctly.Using the Event Debugger
- Navigate to Console > Events > Debugger.
- Select your app and the Sandbox environment.
- Trigger actions in your app (launch, identify, track events).
- Events appear in the debugger within seconds, showing the full payload including event name, properties, user ID, device info, and timestamps.
- Events are arriving with the correct names and properties
- User identification is linking events to the correct user ID
- Automatic events (session start, app open, etc.) are being tracked
- Custom event properties have the expected types and values
The Event Debugger shows events in real-time with a latency of approximately 1-2 seconds. If events are not appearing, check that your SDK is configured with a sandbox key and that the correct environment is selected in the debugger filter.
Webhook Testing
Sandbox webhooks are fully functional and completely isolated from production. This means you can test your webhook endpoint implementation without affecting production data or triggering production workflows.Create a sandbox webhook endpoint
In Console > Settings > Webhooks, create a new endpoint. Ensure you are in the Sandbox environment (toggle at the top of the page).
Subscribe to event types
Select the event types you want to test (e.g.,
subscription.created, onboarding.completed).Trigger events from your test app
Use the SDK configured with a sandbox key to trigger the events. The webhook payloads will be delivered to your endpoint.
During local development, use a tunneling tool like ngrok to expose your local server to the internet. Point your sandbox webhook endpoint to the ngrok URL.
Experiment Testing
Sandbox experiments run independently from production experiments. You can create, run, and analyze experiments in sandbox without any impact on production users or data.Tips for testing experiments
- Use deterministic user IDs. Since experiment assignment is based on
MurmurHash3(userId + experimentId + salt), using consistent test user IDs ensures you always land in the same variant. - Test both variants. Create multiple test users and verify that each variant renders correctly. You can use the dashboard to preview which variant a given user ID will be assigned to.
- Verify exposure tracking. Check the Event Debugger to confirm that
experiment.exposureevents are being tracked whengetVariant()is called.
Pre-Launch Checklist
Before switching from sandbox to production, verify each item:Events appearing in Event Debugger
Open the Event Debugger and confirm that all expected events (both automatic and custom) are arriving with correct names, properties, and user associations.
User identification working
Call
identify() with a test user ID and verify in the Event Debugger that subsequent events are attributed to that user. Confirm that traits are being set correctly.Onboarding flows rendering correctly
Trigger your onboarding flows and verify that all steps display correctly, navigation works, and completion events are tracked.
Paywall presentations triggering
Present your paywalls and verify the layout, pricing, and CTA buttons render correctly. Confirm that impression events (
paywall.impression) appear in the Event Debugger.Push notification tokens registered
Request push permission and verify in the dashboard that the device token appears under the test user. Send a test push notification and confirm delivery.
Common Testing Scenarios
Testing offline behavior
- Configure the SDK with a sandbox key and let it fetch the config successfully.
- Enable airplane mode on the device.
- Trigger actions in your app and verify that:
- Onboarding flows still render (from cache).
- Paywalls still render (from cache).
- Experiment variants still resolve (from cache).
- Events are queued without errors.
- Disable airplane mode and verify that queued events flush to the server (visible in Event Debugger).
Testing config bundle fallback
- Embed an
appdna-config.jsonbundle in your app (see Config Bundles in CI/CD). - Install the app on a device with no internet connection.
- Launch the app and verify that onboarding flows, paywalls, and experiments work from the bundled config.
Testing webhook signature verification
- Create a sandbox webhook endpoint pointed at your server.
- Trigger an event and capture the raw request.
- Verify the
x-appdna-signatureheader matches the expected HMAC-SHA256 of the request body using your signing secret. - Test with an invalid signature to confirm your server rejects it with a 401.
The sandbox environment has the same rate limits as production. If you are running automated tests that generate high event volumes, be mindful of the limits to avoid throttling.