SDK Analytics Events
Send lifecycle and custom events from the mobile SDK.
Event types
- Custom events — any named event with optional data payload (e.g., purchase_completed).
- Retention events — lifecycle signals like app_open, sent automatically on provider mount.
Sending events
json
POST /api/v1/sdk/analytics/events
Authorization: Bearer pk_live_xxx
{
"appID": "app_abc123",
"deviceId": "dev_123",
"sessionId": "sess_456",
"eventName": "purchase_completed",
"data": { "bookingId": "104971", "amount": 199.0 },
"linkContext": { "linkId": "link_123", "campaignId": "campaign_456" },
"timestamp": "2026-05-07T06:30:00.000Z"
}Event ingestion is non-blocking. The SDK receives ok: true immediately after queue acceptance. Processing happens asynchronously.
Processing pipeline
text
SDK POST -> Worker validates minimal schema
-> enqueue to SDK Events Queue
-> return { "ok": true }
Queue consumer -> batch messages
-> validate full schema
-> idempotent write (event_id dedup)
-> Analytics Engine + D1 sampled storageEvents are deduplicated by event_id within a scoped window. Failed messages retry with backoff and eventually route to a dead-letter queue.