Server SDK for the BudgetBakers Partner AISP API, for Node.js and TypeScript.
Zero runtime dependencies (native fetch, node:crypto); dual ESM+CJS with
types included; Node ≥ 20. Default base URL: https://aisp-partner.bbapi.io
(the API key selects sandbox vs live).
Until the package is on npm, download the tarball from the downloads page and install it locally:
npm install ./budgetbakers-partner-sdk-<version>.tgzOnce published, the package name is @budgetbakers/partner-sdk; your code
does not change.
import { BudgetBakers } from '@budgetbakers/partner-sdk';
const bb = new BudgetBakers({ apiKey: process.env.BB_API_KEY! });
// Capability discovery (mode = sandbox|live, decided by the key).
const config = await bb.partner.getConfig();
// Clients upsert by externalId.
const client = await bb.clients.create({ externalId: 'user-42', email: 'u42@example.com', countryCode: 'CZ' });
// Client-scoped calls hide the X-Client-Id header.
const c = bb.client(client.id);
// Hosted connect flow: open hostedUrl in the user's browser, then poll.
const session = await c.connectSessions.create({ returnUrl: 'https://app.example.com/bb-callback' });
const done = await c.connectSessions.waitForTerminal(session.sessionId);
// Accounts: every page walked (Disabled, unselected accounts included).
const accounts = await c.connections.listAccounts(done.connectionId!);
// Cursor pagination as async iterators; filters and delta sync as params.
for await (const tx of c.accounts.transactions(accounts[0].id, { sinceSeq: 0 })) {
// tx.amount is a DecimalString ("1234.56") - money is never a float.
}// Constant-time verification against ALL active secrets (±300 s),
// typed events; unknown types pass through, never throw (respond 2xx).
const result = bb.webhooks.verify(secrets, req.headers['x-bb-signature'], rawBody);
const event = bb.webhooks.parseEvent(rawBody);Verify over the raw request body bytes, before any JSON parsing.
- Typed errors -
PartnerApiError.codeis the stable machine code (error.code); branch on it, never on messages.requestIdcarries theX-Request-Idcorrelation id for support. - Retries - exponential backoff + jitter on 429/5xx honoring
Retry-After; POST retries only when anIdempotency-Keymakes the replay safe (auto-generated UUID on creates, explicitidempotencyKeyoverride). - Money - amounts parsed losslessly from the wire into
DecimalStrings (branded); BigInt helperstoCents/fromCents/sumAmounts. - Nullability - only
idis guaranteed on Client/Connection/Account (plussubscriptionStatuson Account andseq/createdSeq/recordDateon Transaction); everything else is| null. - Paths - reads and creates call
/v2and unwrap the{ data }envelope; the connection lifecycle actions (connections.create/delete/ refresh/reconnect/revoke) call/v1, where they live today.clients.getByExternalIdresolves tonullwhen nothing matches.
Guides and the API reference: https://aisp-docs.bbapi.io. Questions: integration@budgetbakers.com.
Apache-2.0 (see LICENSE and NOTICE). Access to the Partner API itself is
governed by the BudgetBakers Partner Terms of Service.