API Reference
Complete SDK documentation
API Reference
Complete reference for all Ensora SDK exports and types.
Components
EnsoraProvider
Root provider component. Wrap your app's root layout.
import { EnsoraProvider } from '@ensora/react-native';
<EnsoraProvider
apiKey="your_api_key"
projectId="your_project_id"
touchCapture={true}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
apiKey | string | required | Your project API key |
projectId | string | required | Your Ensora project ID |
ingestUrl | string | Ensora cloud | Custom ingest endpoint URL |
touchCapture | boolean | false | Enable touch heatmap recording |
sessionSampleRate | number | 1.0 | Fraction of sessions to record (0–1) |
disabled | boolean | false | Disable all tracking (e.g. for dev builds) |
Functions
track
Send a custom event.
import { track } from '@ensora/react-native';
track(eventName: string, properties?: Record<string, unknown>): voididentify
Associate the current session with a user identity.
import { identify } from '@ensora/react-native';
identify(userId: string, traits?: Record<string, unknown>): voidstartSession
Manually start a new session (sessions start automatically on app foreground).
import { startSession } from '@ensora/react-native';
startSession(): voidendSession
Explicitly end the current session.
import { endSession } from '@ensora/react-native';
endSession(): voidAuto-Captured Events
session_start
Fired when the app enters the foreground or on first launch.
{
"event": "session_start",
"session_id": "uuid",
"timestamp": "2026-01-01T00:00:00Z",
"platform": "ios",
"app_version": "1.0.0"
}nav
Fired on every Expo Router pathname change.
{
"event": "nav",
"session_id": "uuid",
"pathname": "/home",
"previous_pathname": "/onboarding"
}error
Fired on unhandled JS exceptions.
{
"event": "error",
"session_id": "uuid",
"message": "TypeError: Cannot read property...",
"stack": "...",
"pathname": "/checkout"
}Types
EnsoraConfig
type EnsoraConfig = {
apiKey: string;
projectId: string;
ingestUrl?: string;
touchCapture?: boolean;
sessionSampleRate?: number;
disabled?: boolean;
};EventProperties
type EventProperties = Record<string, string | number | boolean | null>;Error Handling
The SDK swallows network errors silently to avoid crashing your app. Events are queued and retried on the next foreground cycle.
Browser Support
The SDK targets React Native 0.71+ and Expo SDK 49+.
Server Support
The ingest endpoint accepts JSON payloads over HTTPS. See the backend documentation for self-hosted setup.
Last updated on