Skip to main content

amba 4.0.8 copy "amba: ^4.0.8" to clipboard
amba: ^4.0.8 copied to clipboard

amba SDK for Flutter — the full 4.0 surface (auth, users, sessions, sync, leagues + 29 more namespaces) for the agent-native backend-as-a-service.

Changelog #

All notable changes to the amba Flutter SDK are documented here. Format follows Keep a Changelog; versions follow SemVer.

4.0.8 — 2026-10-15 #

Added #

  • inventory.purchase(storeId: ...) buys through that store's listing, with its override price, per-user limit and segment. An item an active store limits per user is sold only this way; without storeId the purchase answers 409 STORE_PURCHASE_REQUIRED. The core used to drop store_id, so such an item couldn't be bought with inventory.purchase.

Server behavior #

These ship with the API, so apps on earlier versions get them without an upgrade.

  • A store's segment is enforced: a store with a segment_id is listed, read and sold only to users the segment's last evaluation recorded as members (a user it has not evaluated yet sees it after the next evaluation), and answers 404 NOT_FOUND to everyone else. An item only segment-targeted stores list is sold from the catalog to their members only (403 STORE_ACCESS_REQUIRED).
  • A store purchase charges the listing's override price, the price_cents that stores.getPurchaseOptions now shows.

4.0.7 — 2026-10-15 #

Fixed #

  • iOS apps can call the SDK. The package ships its native core as ios/Frameworks/amba_core.xcframework, a dynamic framework that CocoaPods embeds in the app, and the Dart layer opens it with DynamicLibrary.open('amba_core.framework/amba_core'). Earlier versions shipped a static library (libamba_core.xcframework), and the app's linker kept none of its functions, because nothing in the app refers to them by name. The first call, Amba.configure, then threw Invalid argument(s): Failed to lookup symbol 'amba_init'.
  • iOS simulator builds work. The framework has an ios-arm64_x86_64-simulator slice next to the ios-arm64 device slice. Earlier versions had the device slice only, so flutter build ios --simulator and flutter run on a simulator failed with Library 'amba_core' not found.

Packaging #

  • The iOS framework is 17 MiB for both slices; the earlier device library alone was 99 MiB.
  • Each slice targets iOS 13.0, the minimum amba.podspec declares (arm64 simulators start at iOS 14.0).
  • The framework carries a privacy manifest (PrivacyInfo.xcprivacy), the same one the Swift SDK ships.
  • It works with either CocoaPods linkage: use_frameworks!, which flutter create writes, or use_frameworks! :linkage => :static. Apps change nothing in their Podfile or Xcode settings.
  • An app that added its own linker flags for the earlier static library (such as -force_load or -l"amba_core" in OTHER_LDFLAGS or a Podfile post_install hook) removes them; libamba_core.a is gone, so those flags now fail the link.

4.0.5 — 2026-10-15 #

Changed #

  • Friendship has requesterId and addresseeId: a pending row is incoming when addresseeId equals userId and outgoing when requesterId does.

Server behavior #

These ship with the API, so apps on earlier versions get them without an upgrade.

  • reviews.create works: POST /v1/client/reviews reads the target_type / target_id the SDK sends (it read only item_type / item_id and failed with a 500), and reviews.create / reviews.update come back with author_id, target_type and target_id. target_type is content_item or custom, and rating is a whole number from 1 to 5, such as 4.0; other values answer 400 INVALID_ITEM_TYPE / 400 INVALID_RATING. The core checks the rating before sending.
  • friends.list() returns the accepted friendships, then the pending requests in both directions; it returned the accepted ones only. friends.friends() still returns the accepted ones. Blocked rows stay out of both, and a list holds at most 1000 rows.
  • inventory.purchase with a quantity other than 1 answers 400 QUANTITY_NOT_SUPPORTED and charges nothing. It used to charge for and grant one item whatever the quantity; call it once per item to buy several.

4.0.4 — 2026-10-15 #

Changed #

  • inventory.purchase returns InventoryPurchase (purchased, currencyCode, price, balanceAfter). It was typed as an InventoryItem, which the route never returned; read the bought item with inventory.items().
  • ReferralClaim.referrerId is nullable: a code no user owns has no referrer.

Server behavior #

These ship with the API, so apps on earlier versions get them without an upgrade.

  • config.fetch() evaluates each key's segment and percentage conditions for the signed-in user. Before sign-in, or with an expired session token, it returns each key's default value as before.
  • Deep links, inventory, content items, friendships and referral codes come back with the fields the SDK types declare, so deepLinks.get, inventory.getItems / getItem / consume, content.library / item / createItem / updateItem, every friends method and referrals.getReferralCode / claimReferral return their typed results. Earlier these calls failed reading the response, after the server had already made the change. Claiming a code no user owns needs this version.
  • inventory.consume({ item_id }) takes the catalog item id or the id of a row from inventory.getItems().
  • A single-item inventory.purchase response also carries the inventory row it added to, so earlier versions read it without failing; a bundle purchase needs this version.
  • Each Apple or Google sign-in nonce is accepted once; sending a sign-in or link request again with the same nonce returns 401 NONCE_REUSED.
  • DELETE /v1/client/users/me/push-token deactivates only the signed-in user's own tokens.

4.0.3 — 2026-10-14 #

Security #

  • Ids, keys, short codes and names placed in a request path are percent-encoded, so /, ? and # stay part of the value and the request keeps its route. An id of ., .. or the empty string fails with VALIDATION_ERROR before any request is sent.

Server behavior #

  • New free-tier projects can receive 402 FREE_TIER_LIMIT_REACHED from the sign-in request calls (magic link, email OTP, SMS OTP) once the project's daily sign-in budget is spent, and from email sends, which are a paid feature on those projects. The error's details.limit names the limit and details.upgrade carries the one-call upgrade. Projects created before the free-tier limits keep their previous behavior, and no SDK upgrade is needed.
  • A free project owned by an agent sandbox account that nobody has claimed answers writes with 403 SANDBOX_CLAIM_REQUIRED once it has spent 14 days in that account, until the account is claimed.

Added #

  • Amba.offerings([offeringId]) / AmbaClient.offerings — subscription offerings (the packages your paywall renders, provider-neutral). Pass an offering id for one offering; omit it for all. Parity with Web/Node and the iOS/Android 4.1.0 SDKs.
  • Amba.entitlements.restore() — Restore Purchases: re-syncs the user's owned entitlements server-side and returns the active set (the App Store 3.1.1 requirement). Fails without changing access when the validation engine is unreachable.

Both methods are generated from the same single-source surface manifest that drives every other Amba SDK, so the Flutter surface can no longer silently lag the rest of the family.

4.0.2 — 2026-05-27 #

Version-alignment release across every published Amba package. Brings the infra-tier packages (@layers/amba, @layers/amba-shared, @layers/amba-mcp — previously on 1.x) onto the same 4.x track as the SDKs so customers can pin a single version everywhere. No surface or behavior changes in this SDK.

Removed from the package family in this release: the deprecated @layers/amba-functions and @layers/amba-client packages were unpublished from npm. Amba functions are plain ES modules with the standard export default { async fetch(req, env, ctx) } shape — no wrapper. See docs.amba.dev/functions/runtime for the full contract.

4.0.1 — 2026-05-26 #

Version-alignment release across every Amba SDK. No surface or behavior changes — bumps every SDK (web, node, react, react-native, expo, core, kotlin, swift, flutter, unity) to 4.0.1 so customers can pin to a single version across stacks. See sdks/CANONICAL_API.md for the 4.0 surface.

4.0.0 — 2026-05-25 #

Coordinated 4.0 release across every Amba SDK. All 9 SDKs ship the same surface on the same day; see the canonical spec at sdks/CANONICAL_API.md for the per-method contract.

Breaking #

  • Amba.messaging.getMessage(messageId) now takes (conversationId, messageId) and returns Message? (null when the message can't be found). The pre-4.0 single-arg form called a non-existent FFI symbol — every call threw ArgumentError at dispatch, so no working customer code can be affected.

Added — net-new namespaces #

  • Amba.users — get(userId?), update(patch, {userId?}).
  • Amba.sessions — list(), revoke(sessionId). List/revoke the customer-defined app sessions; distinct from the auth JWT envelope.
  • Amba.sync — pushChanges([SyncChange]), pullChanges(entityType, checkpointToken?). Offline change replay with server-wins conflicts.
  • Amba.leagues — me(), cohort(). Tiered weekly leaderboard cohorts; cohort listings are anonymised (display name only, no user ids).

Added — net-new methods on existing namespaces #

  • Amba.auth.requestMagicLink(email), verifyMagicLink(token), linkAccount(provider, credential).
  • Amba.collections.findNearest(name, vectorField:, queryVector:, k:, filter?) and count(name, filter?).
  • Amba.storage.list(prefix?), delete(assetId), download(assetId) (returns Uint8List — the native core base64-encodes inside a {data:"…"} envelope to keep the FFI ABI string-only; the wrapper decodes on the platform side).
  • Amba.messaging.createConversation({participants, conversationType?, name?}), listMessages(conversationId, {limit?, offset?}), markRead(conversationId).
  • Amba.friends.sendRequest(userId), acceptRequest(friendshipId), declineRequest(friendshipId).
  • Amba.catalog.get(id).

Fixed #

  • Amba.messaging.getMessage — the native core added the long-missing amba_messaging_get_message(conv_id, msg_id) symbol; the wrapper now actually dispatches instead of ArgumentError'ing out. Returns null when the message isn't in the first 5,000 entries of the conversation (the helper paginates list_messages internally since the server has no GET-by-id route).

Test coverage #

  • New tests for every method added above, including the OTP path (zero coverage pre-4.0).

1.0.2 — 2026-05-20 #

Added #

  • Amba.diagnostics.ping() — wire-verify primitive. Call once after Amba.configure(...) to confirm the SDK is talking to the right project with the right API key in the right environment. Returns a PingResult whose fields (serverProjectId, environment, keyFingerprint, latencyMs) are all server-decided, so comparing serverProjectId against the configured project id catches "wrong key in .env" silent failures on the spot. Mirrors the TypeScript SDKs' Amba.diagnostics.ping() shape (added in 1.0.0).
  • dart:developer log() calls from the SDK now use name: "amba-sdk", so Flutter DevTools / flutter logs filtering on that name surfaces amba's own diagnostics without dragging in app-side log noise. The SDK never calls print().

Known limitations #

  • The published xcframework still ships the iOS device slice only (arm64) — unchanged from 1.0.1. Running on an iOS simulator requires building a simulator slice locally. iOS device builds, App Store archives, and Android (all four ABIs) are fully supported out-of-box. The simulator-slice download follow-up tracked in 1.0.1 is still pending.

1.0.1 — 2026-05-20 #

Fixed #

  • Bundled prebuilt native binaries for Android (arm64-v8a, armeabi-v7a, x86_64, x86) and iOS device (arm64) so flutter build apk and flutter build ipa succeed without any local build step.
  • Added android/src/main/kotlin/com/layers/amba/AmbaPlugin.kt and ios/Classes/AmbaPlugin.swift plugin stubs required by Flutter's plugin registration mechanism.
  • Added android/build.gradle, android/src/main/AndroidManifest.xml, and ios/amba.podspec needed for Flutter to discover and link the plugin.
  • Fixed Amba.version constant to match the published package version.

Known limitations #

  • The published xcframework ships the iOS device slice only (arm64). Running on an iOS simulator requires building a simulator slice locally — a follow-up release will add an automated podspec prepare_command that downloads the matching slice on pod install. iOS device builds, App Store archives, and Android (all four ABIs) are fully supported out-of-box.

1.0.0 — 2026-05-16 #

Initial public release of the amba Flutter SDK on pub.dev.

Added #

  • Amba client class wrapping the Amba backend API for Flutter apps: configure with project id + client key; track events; anonymous sign-in; authenticated sign-in via magic link; collection CRUD; AI prompt invocation.
  • Smoke test fixtures under test/integration/ exercising the public surface against a live tenant.
0
likes
0
points
238
downloads

Publisher

unverified uploader

Weekly Downloads

amba SDK for Flutter — the full 4.0 surface (auth, users, sessions, sync, leagues + 29 more namespaces) for the agent-native backend-as-a-service.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ffi, flutter, plugin_platform_interface

More

Packages that depend on amba

Packages that implement amba