Getting Started
Overview
How the Swan SDK fits into your app — and what you wire up first.
At a high level, the Swan SDK is a client library that talks to the Swan backend on behalf of your app. Your app calls SDK methods; the SDK batches events, persists them locally, handles auth / retry, and ships them to the Swan ingestion endpoint.
┌──────────────────────┐ ┌──────────────────────────┐
│ Your app │ │ Swan backend │
│ │ HTTPS │ │
│ ┌────────────────┐ │ ──────► │ /device/register │
│ │ Swan SDK │ │ │ /events │
│ │ (this docs) │ │ ◄────── │ FCM / APNs push out │
│ └────────────────┘ │ Push │ Campaign engine │
└──────────────────────┘ └──────────────────────────┘The minimum integration
- Install the SDK for your platform.
- Call
Swan.init(...)once at app launch with yourappId. - (Optional but recommended) Wire push notification handling — at minimum a provider service / delegate that forwards messages to the SDK.
- Call
Swan.identify(...)when a user signs in. - Track events with
SwanEvents.screen(...), typed e-commerce helpers, orSwan.customEvent(...).
That's the whole shape. The platform-specific guides below cover the syntax for each.