Quickstart
Send your first event into Sankofa with the Flutter SDK, then verify the path from client to engine.
sdk/sankofa_flutter/README.mdexamples/flutter_example/lib/main.dart1. Point the SDK at your engine
The Flutter SDK accepts any of these endpoint forms:
- a server base URL such as
http://localhost:8080 - an API base URL such as
http://localhost:8080/api/v1 - the full ingest URL
http://localhost:8080/api/v1/track
The SDK normalizes those inputs internally before it sends events.
2. Initialize before runApp
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Sankofa.instance.init(
apiKey: 'sk_live_12345',
endpoint: 'http://localhost:8080',
debug: true,
);
runApp(MyApp());
}
3. Track the first event
await Sankofa.instance.track('button_clicked', {
'bg_color': 'blue',
'screen': 'home',
});
4. Identify the user when identity is known
await Sankofa.instance.identify('user_123');
5. Verify the ingest path
- 1
Start the engine
Run the Sankofa engine and make sure your Flutter app can reach the configured endpoint.
- 2
Use a valid API key
The engine rejects missing or invalid x-api-key values. Use the project live or test key you generated in Sankofa.
- 3
Watch the dashboard
After the first track call succeeds, the event should appear inside the project environment that matches the API key you used.
Why the SDK accepts several endpoint shapes
The Flutter SDK normalizes the endpoint with resolveServerBaseUri and
resolveTrackUri. That lets local development and production setups use the
same initialization call shape even when you pass different base paths.
Direct transport model
The SDK writes one JSON payload per queued transport item:
trackevents go toPOST /api/v1/trackpeopleupdates go toPOST /api/v1/peoplealiasevents go toPOST /api/v1/alias
If you are not using Flutter, continue with the HTTP ingestion guide.