TypeScript SDK
Official TypeScript SDK for the Amboss Payments API. Typed clients for environments, wallets, and transactions, plus built-in webhook verification.
The official TypeScript SDK for the Amboss Payments API. It wraps the payments GraphQL API in a fully typed client, so you send and receive payments, manage environments and wallets, and verify webhooks without writing a single GraphQL query.
The SDK talks to the same API documented under Payments. Everything you can do over raw GraphQL you can do here, with types, autocompletion, and helpers that do the fiddly parts (node routing, webhook HMAC) for you.
Install
pnpm add @ambosstech/payments
# or
npm install @ambosstech/payments@ambosstech/core comes along as a transitive dependency, so there is nothing else to install. Requires Node.js 18.18 or newer.
Quick start
import { Payments } from "@ambosstech/payments";
const payments = new Payments({
serviceApiKey: process.env.AMBOSS_API_KEY,
});
// List your environments and their wallets.
const environments = await payments.environments.list();
const [environment] = environments;
const wallets = await payments.wallets.list({ environmentId: environment.id });
// Mint a Lightning invoice.
const invoice = await payments.transactions.createReceive({
wallet_id: wallets[0].id,
amount: "1000", // base units (sats for BTC)
});
console.log(invoice.payment_request); // BOLT11 to share with the payerCapabilities
| Feature | Description |
|---|---|
| Fully typed | Environments, wallets, and transactions are typed end to end from the GraphQL schema. Inputs, responses, and errors autocomplete in your editor. |
| Send and receive | Create invoices with createReceive and pay BOLT11 invoices or Lightning Addresses with send, including live progress callbacks. |
| Automatic node routing | Sends pick the right node endpoint (LND for BTC, litd for Taproot Assets) from the wallet's asset. No manual wiring. |
| Webhook verification | Verify HMAC-signed webhook deliveries in one call, with a typed event payload and typed error codes. No manual crypto. |
| Sandbox parity | The same code drives sandbox and live. Force deterministic outcomes in sandbox with the amb_sandbox_behavior flag. |