Quickstart

Send your first event into Sankofa in under five minutes — pick your platform, install, initialize, and verify.

This guide walks you through sending your first event from any official Sankofa SDK, identifying a user, and verifying the path end-to-end. You'll need a project API key — get one from the dashboard under Project → API keys.

1. Install the SDK

bash
npm install @sankofa/browser
# or
pnpm add @sankofa/browser

2. Initialize with your API key

Use a live key for production builds and a test key for local development. The engine resolves the environment from the key on every request, so the same code path works for both.

TypeScriptsrc/sankofa.ts
import { Sankofa } from "@sankofa/browser";

await Sankofa.init({
apiKey: process.env.NEXT_PUBLIC_SANKOFA_KEY!,
endpoint: "https://api.sankofa.dev",
});

3. Track an event

TypeScript
Sankofa.track("checkout_started", {
cart_value: 49.99,
item_count: 3,
currency: "USD",
});

4. Identify the user

When the user signs in (or you discover their identity), call identify. Sankofa stitches the pre-identify anonymous traffic onto the resolved user automatically.

TypeScript
await Sankofa.identify("user_123", {
email: "ada@example.com",
plan: "pro",
});

5. Verify the path

  1. Check the dashboard

    Open app.sankofa.dev → your project → Live events. Your checkout_started event should appear within a few seconds.

  2. Confirm the environment

    The event card shows whether it was ingested as live or test. If it landed on the wrong side, you used the wrong API key — see Environments and API keys.

  3. Validate identity stitching

    After your identify call, the same event should appear on the People view, attributed to user_123. Anonymous events from before identify get re-attributed automatically.

Edit this page on GitHub