Skip to content

Node SDK

The Node SDK is generated from the OpenAPI contract, covers every operation, and has zero runtime dependencies (uses global fetch, Node 18+).

Terminal window
npm install @bizzle/sdk-node
import { BizzleClient } from "@bizzle/sdk-node";
const bizzle = new BizzleClient({
apiKey: process.env.BIZZLE_SECRET_KEY, // sk_test_… or sk_live_…
// baseUrl: "https://api.bizzle.my/v1", // optional (default)
});
const payment = await bizzle.createPayment({
body: { amount: 50000, currency: "TZS", description: "Order #1042" },
idempotencyKey: "order-1042",
});
console.log(payment.id, payment.status, payment.checkout_url);

Every operation accepts:

{ query?, body?, idempotencyKey?, headers? }

Operations with path parameters take them as the first argument, e.g.:

const payment = await bizzle.getPayment({ id: "pay_123" });

Failures throw BizzleApiError with .status and .body:

import { BizzleApiError } from "@bizzle/sdk-node";
try {
await bizzle.createPayment({ body: { amount: 0, currency: "TZS" } });
} catch (err) {
if (err instanceof BizzleApiError) console.error(err.status, err.body);
}