Ensora
Ensora
DocumentationInstallationBasic Usage

Advanced

Error TrackingPrivacy & Utilities

API Reference

API Reference

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

PropTypeDefaultDescription
apiKeystringrequiredYour project API key
projectIdstringrequiredYour Ensora project ID
ingestUrlstringEnsora cloudCustom ingest endpoint URL
touchCapturebooleanfalseEnable touch heatmap recording
sessionSampleRatenumber1.0Fraction of sessions to record (0–1)
disabledbooleanfalseDisable 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>): void

identify

Associate the current session with a user identity.

import { identify } from '@ensora/react-native';

identify(userId: string, traits?: Record<string, unknown>): void

startSession

Manually start a new session (sessions start automatically on app foreground).

import { startSession } from '@ensora/react-native';

startSession(): void

endSession

Explicitly end the current session.

import { endSession } from '@ensora/react-native';

endSession(): void

Auto-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

Privacy & Utilities

Helper utilities for privacy, masking, and SDK configuration

On this page

API Reference
Components
EnsoraProvider
Props
Functions
track
identify
startSession
endSession
Auto-Captured Events
session_start
nav
error
Types
EnsoraConfig
EventProperties
Error Handling
Browser Support
Server Support