Amba

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 has a native SDK for every major mobile and web stack. Every SDK exposes the same set of features — auth, content, collections, storage, events, push, entitlements, AI, segments, streaks, gamification, config, and flags — with the idioms of each language. Pick yours below.

Most quickstarts get you from install to your first authenticated API call in under 10 minutes.

Platform matrix

PlatformPackageRegistryInstallMin runtimeNative features
Web@layers/amba-webnpmpnpm add @layers/amba-webNode 20+ / modern browserAuto-RLS, file upload, push (web push)
Node@layers/amba-nodenpmpnpm add @layers/amba-nodeNode 20+asUser() server pattern, Connect middleware
React@layers/amba-reactnpmpnpm add @layers/amba-react @layers/amba-web reactReact 18+ / Node 20+Hooks (useUser, useCollection, useFlag)
React Native@layers/amba-react-nativenpmpnpm add @layers/amba-react-native @react-native-async-storage/async-storageRN 0.73+ / Expo SDK 50+Native push, Apple/Google sign-in
Expo@layers/amba-exponpmnpx expo install @layers/amba-expo @react-native-async-storage/async-storage expo-secure-storeExpo SDK 50+Expo config plugin, push entitlements, URL schemes
iOS / SwiftAmbaSPM (layers/amba-sdk-ios).package(url: "https://github.com/layers/amba-sdk-ios", from: "4.0.0")iOS 14, macOS 12, tvOS 14, watchOS 7Apple sign-in, APNs push
Android / Kotlincom.layers.amba:amba-sdk-androidMaven Centralimplementation("com.layers.amba:amba-sdk-android:4.1.0")Android API 24+ / Kotlin 1.9+Google sign-in, FCM push
Flutterambapub.devflutter pub add ambaFlutter 3.10+ / Dart 3.1+iOS + Android via platform channels
Unity / C#com.layers.ambaUPM (layers/amba-sdk-unity)git URL in Package ManagerUnity 2022.3+ LTSiOS + Android + macOS + Windows + Linux (WebGL: events only)

Every SDK behaves identically — same methods, same return types, same error codes — with each language's natural conventions.

What every SDK does

  • Auth — anonymous, email/password, Sign in with Apple, Sign in with Google. Where each SDK keeps the session is listed under Session storage by SDK.
  • Collections — typed reads + writes against your project's own database, with server-side auto-scoped forcing WHERE user_id = appUserId on every query. Same expressive 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 remote-config bundle and the project's feature flags.

See the client SDK reference for every method signature.

Credentials

Every SDK needs two values from amba init (or Project Settings in the console):

  • Project ID — a UUID that identifies your project. Safe to include in client bundles.
  • Client key — starts with amb_dev_ck_ (development) or amb_live_ck_ (production). Authenticates SDK requests. Treat it like a publishable key: it's scoped to client-side operations and carries no admin rights, but don't commit it to source.

Inject both via environment variables — see each SDK page for the platform-appropriate pattern (.xcconfig on iOS, BuildConfig on Android, --dart-define on Flutter, EXPO_PUBLIC_* on Expo, process.env.* on web/Node).

Session storage by SDK

SDKWhere the session token, refresh token, and anonymous id live
Web, ReactBrowser localStorage, so a page reload keeps the user signed in
NodeProcess memory
React NativeTokens: the iOS Keychain / Android Keystore through react-native-keychain or a secureStorage adapter (tokenStorage: "secure", the default), memory with neither, plain AsyncStorage with tokenStorage: "asyncStorage". Anonymous id: AsyncStorage
ExpoSession and refresh tokens: SecureStore on iOS and Android when expo-secure-store and AsyncStorage are installed and SecureStore is available; otherwise memory by default, or plain AsyncStorage with tokenStorage: "asyncStorage". Anonymous id: AsyncStorage
iOS, Android, Flutter, UnityProcess memory; each launch starts signed out with a new anonymous id

See React Native token storage and Expo token storage for the details.

Choosing the right SDK

  • Building a mobile app? Use the native SDK for that platform — Swift on iOS, Kotlin on Android. The native SDKs keep the session in memory for the life of the process, so the app signs the user in on each launch (see Session storage by SDK).
  • 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 amba Dart package — same surface as every other SDK.
  • Building a game? Use the Unity SDK. iOS, Android, macOS, Windows, and Linux are fully supported. WebGL builds support events only.
  • Building a Next.js / Vite / SvelteKit web app? Use @layers/amba-web. Add @layers/amba-react on top if you want React hooks.
  • Building a Node backend service? Use @layers/amba-node. It exposes the same surface plus an asUser(uid) pattern for per-request user scoping and a Connect-style middleware() 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.

On this page