Code samples
Side-by-side code samples for the 6 canonical amba operations — init, identify, track, collection insert, storage upload, push register — across all 8 SDK languages.
Every amba SDK exposes the same 6 canonical operations. The snippets below show the idiomatic shape per language so you can compare ergonomics before committing to a stack.
API key placeholder is amb_dev_ck_XXXX throughout — replace with the dev key from amba init or app.amba.dev before running.
Each snippet shows the idiomatic shape per language. The per-platform quickstart pages (Web, Node, React, React Native, Expo, iOS, Android, Flutter, Unity) carry the full setup — auth flow, error handling, push registration — surrounding each operation.
1. Init
Configure the SDK once at app start.
2. Identify (sign in)
Establish an authenticated appUserId you can attach data to. Sample shown for anonymous sign-in; every SDK also supports email, Sign in with Apple, and Sign in with Google.
3. Track an event
4. Collection insert
Insert a row into a collection already created via amba collections create posts --field title:text --field body:text. The server stamps user_id from the active session.
5. Storage upload
6. Push register
See also
- Client API reference — HTTP endpoint reference for every namespace.
- Per-platform quickstarts: Web, Node, React, React Native, Expo, iOS, Android, Flutter, Unity.