@layers/amba-core-wasm
The amba SDK's Rust core compiled to WebAssembly. Internal package — applications consume one of the friendlier wrappers:
| Browser | @layers/amba-web |
| Node.js | @layers/amba-node |
| React Native (Expo Go + bare RN) | @layers/amba-react-native |
| Expo with config plugin | @layers/amba-expo |
| Any other JS runtime | this package, directly |
Direct usage
import init, { AmbaCoreWasm } from "@layers/amba-core-wasm";
await init();
const core = AmbaCoreWasm.init(
JSON.stringify({
api_key: "amba_pk_…",
sdk_platform: "web",
sdk_wrapper_version: "custom/1.0.0",
}),
window.fetch.bind(window),
);
await core.track("app_opened", JSON.stringify({ source: "deep_link" }));
const user = await core.signInAnonymously();
console.log(user);
Source
The Rust source lives at core/ in this monorepo. To rebuild after Rust changes:
pnpm --filter @layers/amba-core-wasm run build
License
MIT.