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
npm install @sankofa/browser
# or
pnpm add @sankofa/browserdependencies:
sankofa_flutter: ^1.0.0npm install @sankofa/react-native
# Expo Config Plugin auto-applies on prebuild.package(url: "https://github.com/sankofa-hq/sankofa-ios.git", from: "1.0.0")dependencies {
implementation("dev.sankofa:sankofa-android:1.0.0")
}npm install @sankofa/nodego get github.com/sankofa-hq/sankofa_sdk_gopip install sankofa-catch2. 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.
import { Sankofa } from "@sankofa/browser";
await Sankofa.init({
apiKey: process.env.NEXT_PUBLIC_SANKOFA_KEY!,
endpoint: "https://api.sankofa.dev",
});void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Sankofa.instance.init(
apiKey: 'sk_live_...',
endpoint: 'https://api.sankofa.dev',
);
runApp(const MyApp());
}import { Sankofa } from "@sankofa/react-native";
Sankofa.init({
apiKey: "sk_live_...",
endpoint: "https://api.sankofa.dev",
});import Sankofa
Sankofa.shared.initialize(
apiKey: "sk_live_...",
config: SankofaConfig(recordSessions: true)
)Sankofa.init(
context = this,
apiKey = "sk_live_...",
config = SankofaConfig(recordSessions = true)
)import { Sankofa } from "@sankofa/node";
Sankofa.init({
apiKey: process.env.SANKOFA_KEY!,
endpoint: "https://api.sankofa.dev",
});import "github.com/sankofa-hq/sankofa_sdk_go/sankofa"
client, err := sankofa.New(sankofa.Config{
APIKey: os.Getenv("SANKOFA_KEY"),
Endpoint: "https://api.sankofa.dev",
})
if err != nil { log.Fatal(err) }import sankofa
sankofa.init(
api_key=os.environ["SANKOFA_KEY"],
endpoint="https://api.sankofa.dev",
)3. Track an event
Sankofa.track("checkout_started", {
cart_value: 49.99,
item_count: 3,
currency: "USD",
});await Sankofa.instance.track('checkout_started', {
'cart_value': 49.99,
'item_count': 3,
'currency': 'USD',
});Sankofa.track("checkout_started", {
cart_value: 49.99,
item_count: 3,
currency: "USD",
});Sankofa.shared.track("checkout_started", properties: [
"cart_value": 49.99,
"item_count": 3,
"currency": "USD"
])Sankofa.track("checkout_started", mapOf(
"cart_value" to 49.99,
"item_count" to 3,
"currency" to "USD"
))Sankofa.track("checkout_started", {
cart_value: 49.99,
item_count: 3,
currency: "USD",
}, { distinctId: "user_123" });client.Track(ctx, sankofa.Event{
Name: "checkout_started",
DistinctID: "user_123",
Properties: map[string]any{
"cart_value": 49.99,
"item_count": 3,
"currency": "USD",
},
})sankofa.track("checkout_started", {
"cart_value": 49.99,
"item_count": 3,
"currency": "USD",
}, distinct_id="user_123")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.
await Sankofa.identify("user_123", {
email: "[email protected]",
plan: "pro",
});await Sankofa.instance.identify('user_123', traits: {
'email': '[email protected]',
'plan': 'pro',
});Sankofa.identify("user_123", {
email: "[email protected]",
plan: "pro",
});Sankofa.shared.identify(userId: "user_123", traits: [
"email": "[email protected]",
"plan": "pro"
])Sankofa.identify("user_123", mapOf(
"email" to "[email protected]",
"plan" to "pro"
))Sankofa.identify("user_123", {
email: "[email protected]",
plan: "pro",
});client.Identify(ctx, sankofa.Person{
DistinctID: "user_123",
Traits: map[string]any{"email": "[email protected]", "plan": "pro"},
})sankofa.identify("user_123", traits={
"email": "[email protected]",
"plan": "pro",
})5. Verify the path
Check the dashboard
Open app.sankofa.dev → your project → Live events. Your
checkout_startedevent should appear within a few seconds.Confirm the environment
The event card shows whether it was ingested as
liveortest. If it landed on the wrong side, you used the wrong API key — see Environments and API keys.Validate identity stitching
After your
identifycall, the same event should appear on the People view, attributed touser_123. Anonymous events from beforeidentifyget re-attributed automatically.
What to read next
Concepts
Events deep dive
Naming conventions, default properties, and how events flow through the engine.
Hands-on
Your first feature flag
Roll out a feature to a cohort, gate behind A/B variants, and halt on a Catch signal.
API reference
Direct HTTP ingestion
Skip the SDK and POST events to /api/v1/track from any environment.