Install
Initialize
Track an event
Identify a user
Track a purchase
Core methods
| Method | Use it to |
|---|---|
initialize(config) | Initialize the SDK. |
track(name, properties?) | Track an event. |
screen(name, properties?) | Track a screen view. |
identify(userId, properties?) | Identify a user. |
alias(newUserId, previousId?) | Link two IDs for the same user. |
reset() | Clear identity on logout. |
flush() | Send queued events immediately. |
trackPurchase(...) | Track purchase revenue. |
reset() whenever a user signs out or switches accounts.
Configuration
| Option | Default | What it controls |
|---|---|---|
apiKey | Required | Workspace API key. |
workspaceId | — | Optional workspace identifier. |
debug | false | Development logging. |
maxRetries | 3 | Delivery retries. |
retryDelay | 1000 | Delay between retries in milliseconds. |
timeout | 15000 | Request timeout in milliseconds. |
batchSize | 10 | Events sent in each batch. |
flushInterval | 30000 | Automatic flush interval in milliseconds. |
maxQueueSize | 100 | Maximum queued events. |
enableAutoEvents | true | App lifecycle and session tracking. |
enableAttribution | true | Campaign and deep-link attribution. |
enableWebToAppAttribution | true | Web-to-app matching when supported. |
skadTemplate | — | iOS conversion template: ecommerce, gaming, or subscription. |
apiUrl, maxEventQueueSize, autoEvents, and retryConfig are still accepted but should not be used in new implementations.
Identity
alias only when the old and new IDs belong to the same person. reset() rotates local identity and clears user-scoped attribution.
Screens
Track a screen manually:datalyrScreenTracking or createScreenTrackingListeners. For Expo Router, use the Expo entry and useDatalyrScreenTracking.
Revenue events
Attribution and journeys
setAttributionData() only when your app already has trusted campaign information that the SDK could not capture automatically.
Deep links
The SDK captures supported deep-link and install-referrer values when attribution is enabled. You can read a deferred result with:iOS tracking authorization
RevenueCat and Superwall
Queue and lifecycle
Events created before initialization are temporarily buffered. Offline events are queued and retried when connectivity returns.flush() when immediate delivery matters. destroy() stops listeners and background work; only call it when tearing down the SDK.