Swan SDK
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

  1. Install the SDK for your platform.
  2. Call Swan.init(...) once at app launch with your appId.
  3. (Optional but recommended) Wire push notification handling — at minimum a provider service / delegate that forwards messages to the SDK.
  4. Call Swan.identify(...) when a user signs in.
  5. Track events with SwanEvents.screen(...), typed e-commerce helpers, or Swan.customEvent(...).

That's the whole shape. The platform-specific guides below cover the syntax for each.

Pick your platform

On this page