Expo Setup
The Pulse plugin automatically injects native initialization into your iOS and Android native code during expo prebuild — no manual AppDelegate (Swift or Objective-C) or MainApplication edits needed.
Step 1 — Install Package
yarn add @dreamhorizonorg/pulse-react-native
Step 2 — Configure Plugin
Add the plugin to app.json or app.config.js:
{
"expo": {
"plugins": [
[
"@dreamhorizonorg/pulse-react-native",
{
"apiKey": "your-api-key",
"dataCollectionState": "ALLOWED"
}
]
]
}
}
Step 3 — Run Prebuild
npx expo prebuild --clean
This applies the plugin to the native projects. Run once after changing plugin config.
Step 4 — Initialize in JS
import { Pulse } from '@dreamhorizonorg/pulse-react-native';
Pulse.start();
export default function App() {
// your app
}
Plugin Configuration Options
Top-level (required)
| Option | Description |
|---|---|
apiKey | Project API key |
dataCollectionState | "ALLOWED", "PENDING", or "DENIED" (see Data Collection Consent) |
ios section
| Option | Description |
|---|---|
apiKey | Override API key for iOS only |
dataCollectionState | Override consent for iOS only |
globalAttributes | Key/value pairs attached to all iOS telemetry |
configuration | includeScreenAttributes, includeNetworkAttributes, includeGlobalAttributes |
instrumentation | Enable/disable specific instrumentations |
android section
| Option | Description |
|---|---|
apiKey | Override API key for Android only |
dataCollectionState | Override consent for Android only |
globalAttributes | Key/value pairs attached to all Android telemetry |
instrumentation | activity, network, anr, crash, slowRendering, fragment, interaction |
Full example with per-platform overrides:
{
"expo": {
"plugins": [
[
"@dreamhorizonorg/pulse-react-native",
{
"apiKey": "your-api-key",
"dataCollectionState": "ALLOWED",
"ios": {
"globalAttributes": {
"environment": "production"
}
},
"android": {
"globalAttributes": {
"environment": "production"
},
"instrumentation": {
"interaction": { "enabled": true },
"slowRendering": { "enabled": false }
}
}
}
]
]
}
}
Next Steps
- Configuration — JS-layer options for
Pulse.start() - Installation — Manual setup for bare React Native