SDKs
Native client SDKs for every platform — Swift, Kotlin, Flutter, Unity, Web, Node, React, React Native, Expo — exposing the same uniform surface across every platform.
amba ships first-party SDKs for every platform a typical consumer app touches. Every SDK exposes the same surface (auth, collections, storage, events, push, entitlements, AI, config, flags, plus the gamification/social/lifecycle bundles). Behavior is identical across languages — the differences are idiomatic ergonomics, not protocol drift.
Pick the language for your platform and follow the quickstart. Every quickstart targets under 10 minutes from install to first authenticated request.
Platform matrix
| Platform | Package | Registry | Install | Min runtime | Native features |
|---|---|---|---|---|---|
| Web | @layers/amba-web | npm | pnpm add @layers/amba-web | Node 20+ / modern browser | Auto-RLS, file upload, push (web push) |
| Node | @layers/amba-node | npm | pnpm add @layers/amba-node | Node 20+ | asUser() server pattern, Connect middleware |
| React | @layers/amba-react | npm | pnpm add @layers/amba-react @layers/amba-web react | React 18+ / Node 20+ | Hooks (useUser, useCollection, useFlag) |
| React Native | @layers/amba-react-native | npm | pnpm add @layers/amba-react-native @react-native-async-storage/async-storage | RN 0.73+ / Expo SDK 50+ | Native push, Apple/Google sign-in |
| Expo | @layers/amba-expo | npm | npx expo install @layers/amba-expo @react-native-async-storage/async-storage | Expo SDK 50+ | Expo config plugin, push entitlements, URL schemes |
| iOS / Swift | Amba | SPM (layers/amba-sdk-ios) | .package(url: "https://github.com/layers/amba-sdk-ios", from: "0.1.0") | iOS 14, macOS 12, tvOS 14, watchOS 7 | Apple sign-in, APNs push |
| Android / Kotlin | com.layers.amba:amba-sdk-android | Maven Central | implementation("com.layers.amba:amba-sdk-android:0.1.0") | Android API 24+ / Kotlin 1.9+ | Google sign-in, FCM push, EncryptedSharedPreferences |
| Flutter | amba | pub.dev | flutter pub add amba | Flutter 3.10+ / Dart 3.1+ | iOS + Android via platform channels |
| Unity / C# | com.layers.amba | UPM (layers/amba-sdk-unity) | git URL in Package Manager | Unity 2022.3+ LTS | iOS + Android + macOS + Windows + Linux (WebGL: events only) |
Every SDK uses the same shared core implementation, exposed through idiomatic bindings per language. Identical behavior, idiomatic API.
What every SDK does
- Auth — anonymous, email/password, Sign in with Apple, Sign in with Google. Sessions persist across restarts (every SDK has a default
AmbaStoragefor its platform). - Collections — typed reads + writes against your project's own Postgres-compatible database, with server-side auto-RLS forcing
WHERE user_id = appUserIdon every query. Same Mongo-style filter DSL on the client and inside customer functions. - Storage — presign → PUT → commit upload flow. Per-bucket retention + cascade-on-user-delete.
- Events —
track(event, properties)sends to engagement events. Same DSN as analytics. - Push — register the platform-native token (APNs, FCM, web push). Server-side fan-out with per-campaign retries and DLQ.
- Entitlements — RevenueCat / App Store / Stripe entitlement state, cached per-user.
- AI proxy — call Anthropic via amba so provider keys stay server-side.
- Config + flags — fetch the resolved remote-config bundle and feature-flag assignments per user.
See the client SDK reference for every method signature.
API key placeholder
Throughout these docs the API key is shown as:
That's a placeholder — your real key starts with amb_dev_ck_ (dev) or amb_live_ck_ (production) followed by 32 random characters. Get one from amba init or the console.
Choosing the right SDK
- Building a mobile app? Use the native SDK for that platform — Swift on iOS, Kotlin on Android. Each integrates with platform credentials (Keychain, EncryptedSharedPreferences) so your users' tokens stay where the OS expects them.
- Building cross-platform with React Native or Expo? Use
@layers/amba-react-native(bare RN) or@layers/amba-expo(managed workflow). Both expose the same surface. - Building cross-platform with Flutter? Use the
ambaDart package — same surface as every other SDK. - Building a game? Use the Unity SDK. iOS / Android / macOS / Windows / Linux are fully supported; WebGL builds are events-only (no auth or collections — WebGL has no filesystem for the persistence layer).
- Building a Next.js / Vite / SvelteKit web app? Use
@layers/amba-web. Add@layers/amba-reacton top if you want React hooks. - Building a Node backend service? Use
@layers/amba-node. It exposes the same surface plus anasUser(uid)pattern for per-request user scoping and a Connect-stylemiddleware()factory.
See also
- Quickstart — provision a project + deploy a function + define a collection.
- Client API reference — HTTP endpoint reference for every namespace.
- Code samples — side-by-side init / identify / track / collection / storage / push across all 8 languages.