@layers/amba-node
v2.0.2
Published
amba SDK for Node.js server apps — full 25-namespace surface for backend integration with amba.
Downloads
955
Readme
@layers/amba-node
Amba is the agent-native backend-as-a-service for mobile and web apps. This package is the Node.js SDK — the server-side companion to @layers/amba-web, with the same 25-namespace surface and idiomatic Node ergonomics.
Install
npm install @layers/[email protected]Configure + first call
import { AmbaClient } from "@layers/amba-node";
const amba = await AmbaClient.configure({
apiKey: process.env.AMBA_API_KEY!,
});
await amba.events.track("webhook_received", { source: "stripe" });Express middleware
import express from "express";
import { AmbaClient } from "@layers/amba-node";
const amba = await AmbaClient.configure({ apiKey: process.env.AMBA_API_KEY! });
const app = express();
app.use(amba.middleware());
app.post("/webhook", (req, res) => {
req.amba.events.track("webhook_received");
res.sendStatus(204);
});Docs
Full reference: https://docs.amba.dev/sdk/node.
License
MIT
