Configure Expo Observe
Edit page
Control how Expo Observe collects and dispatches metrics, including environment settings, development mode, and custom endpoints.
For the complete documentation index, see llms.txt. Use this file to discover all available pages.
Configure Expo Observe at runtime to fit your app's build setup, environment, and data routing. This page covers the configure() and dispatchEvents(), enabling metrics in development, using a custom endpoint, and separating data by environment.
configure()
Use the configure() method to control how Expo Observe behaves at runtime:
import ExpoObserve from 'expo-observe'; ExpoObserve.configure({ environment: 'production', dispatchingEnabled: true, });
| Option | Type | Default | Description |
|---|---|---|---|
environment | string | process.env.NODE_ENV | The environment label for observability events |
dispatchingEnabled | boolean | true | Whether to send collected events to the server |
dispatchEvents()
Events are automatically dispatched when the app moves to the background. On Android, a background worker dispatches events once network connectivity is available. On iOS, this happens when the app resigns active state or is about to terminate.
To flush events manually (for example, during testing or to ensure events are sent before a specific point), call dispatchEvents():
import ExpoObserve from 'expo-observe'; await ExpoObserve.dispatchEvents();
Enable metrics in development
By default, metrics with the development environment are filtered out and not dispatched to the server. To collect development metrics (for example, to test your integration), set enableInDebug to true in your app config:
{ "expo": { "extra": { "eas": { "observe": { "enableInDebug": true } } } } }
Enable this only when testing your Expo Observe integration. Development performance differs significantly from production, so collecting development metrics may affect the results shown in your dashboard.
Custom endpoint
If you need to change the endpoint for the observability API, set the endpointUrl value in your app config:
{ "expo": { "extra": { "eas": { "observe": { "endpointUrl": "https://your-custom-endpoint.com" } } } } }
The endpoint URL is baked into the native layer of the app at build time, so changing it requires regenerating native code. After updating your app config, run npx expo prebuild and create a new build to apply the change.
Environments
All metrics are grouped by environment. The environment value is derived from process.env.NODE_ENV by default. To override it, use configure({ environment }).
Metrics with the development environment are filtered out before dispatching unless enableInDebug is set to true in your app config. You can also disable all dispatching globally using configure({ dispatchingEnabled: false }).