Skip to main content

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)

OptionDescription
apiKeyProject API key
dataCollectionState"ALLOWED", "PENDING", or "DENIED" (see Data Collection Consent)

ios section

OptionDescription
apiKeyOverride API key for iOS only
dataCollectionStateOverride consent for iOS only
globalAttributesKey/value pairs attached to all iOS telemetry
configurationincludeScreenAttributes, includeNetworkAttributes, includeGlobalAttributes
instrumentationEnable/disable specific instrumentations

android section

OptionDescription
apiKeyOverride API key for Android only
dataCollectionStateOverride consent for Android only
globalAttributesKey/value pairs attached to all Android telemetry
instrumentationactivity, 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