Amba

Client API

SDK-facing routes called by @amba/client on end-user devices.

Everything under /client is what end-user devices hit via the @amba/client SDK. Every request requires the project's client API key in X-Api-Key. After a user signs in, the SDK attaches the session token as a Bearer.

Shape

POST /client/auth/anonymous
X-Api-Key: amb_client_ck_xxx
Content-Type: application/json
GET /client/users/me
X-Api-Key: amb_client_ck_xxx
Authorization: Bearer <session-token>

/client/auth/* and /client/config accept requests with only X-Api-Key. All other client routes require both headers.

Modules

ModulePrefixPurpose
auth/client/authAnonymous, Apple, Google, email signup / login / link, refresh, logout.
sync/client/syncMulti-module delta sync for background refresh.
events/client/eventsSingle endpoint POST /client/events for Amba.track().
users/client/usersCurrent user profile + push-token registration.
config/client/configEvaluated remote-config bundle (ETag-aware).
entitlements/client/entitlementsCurrent user's active entitlements.
content/client/contentToday's content, library reads, user-owned item CRUD.
streaks/client/streaksRead streaks, qualify a streak.
xp/client/xpXP, history, rules.
achievements/client/achievementsAchievement list + single lookup with progress.
challenges/client/challengesActive challenges, join, user's own.
leaderboards/client/leaderboardsLeaderboard list, entries, user's rank.
currencies/client/currenciesBalances + transactions.
catalog/client/catalogCatalog browsing.
stores/client/storesStorefront listings.
inventory/client/inventoryOwned items, purchase, consume.
referrals/client/referralsUser's referral code + redemption.
feeds/client/feedsPersonalized and group feeds.
friends/client/friendsFriend requests + lifecycle.
groups/client/groupsCreate, search, join, leave, members.
messaging/client/messagingConversations, messages, read receipts.
reviews/client/reviewsSubmit + edit + fetch reviews.
moderation/client/moderationUser-initiated reports.
onboarding/client/onboardingOnboarding state machine.
deep-links/client/deep-linksSlug resolution + click tracking.
media/client/mediaRead media + upload.
roles/client/rolesCurrent user's roles + permissions.
sessions/client/sessionsSession lifecycle (start / end / heartbeat).

Common errors

CodeStatusMeaning
UNAUTHORIZED401Missing or invalid X-Api-Key / session token.
TOKEN_EXPIRED401Session token expired — call POST /client/auth/refresh.
NOT_FOUND404Resource does not exist or isn't owned by the current user.
INVALID_INPUT400Request body failed validation.
RATE_LIMITED429Too many requests — back off.

On this page