Skip to content

Developers

Payments code that is hard to get wrong.

Two SDKs with no runtime dependencies. The server one signs every request and hides its own secret. The browser one only ever holds a publishable key.

@bu-payment/node-sdk
$ bun add @bu-payment/node-sdk
import { parseClientConfig } from "@bu-payment/node-sdk";

const config = parseClientConfig({
  applicationId: process.env.BUPAYMENT_APP_ID!,
  keyId: process.env.BUPAYMENT_KEY_ID!,
  secret: process.env.BUPAYMENT_SECRET!,
  apiBaseUrl: process.env.BUPAYMENT_API_BASE_URL!,
});

// The environment comes from keyId:
// a test key can never be pointed at live.
@bu-payment/browser-sdk
$ bun add @bu-payment/browser-sdk
import { createBuPaymentClient } from "@bu-payment/browser-sdk";

const buPayment = createBuPaymentClient({
  publishableKey: "bup_pk_test_...",
  apiBaseUrl: "https://api.example.com",
});

const checkout = buPayment.checkout
  .priceId("price_pro_monthly")
  .email("buyer@example.com")
  .quantity(1)
  .start();

Quick start

From an empty account to a test payment in four steps.

  1. Create an App

    An App groups the credentials, allowed origins and payments of one product you sell.

  2. Issue its credentials

    A confidential credential for your server, and a publishable key for the browser.

  3. Start a checkout

    Point the browser SDK at a price from your catalogue and await the result.

  4. Listen for events

    Add a webhook endpoint and react when a payment succeeds or an invoice is paid.

Apps and credentials

One App per product, with keys scoped to what they do.

Each App holds its own Test and Live credentials. Choose the capabilities a credential carries, restrict the origins that may use it, and rotate or revoke it when someone leaves.

  • Confidential credentials for servers, publishable keys for browsers
  • Capabilities you can change without rotating the key
  • Allowed origins checked on every browser request
Apps page showing app capacity and the Playground app
Developers overview with API requests, error rate, webhook deliveries and events emitted

Webhooks and logs

See every request you sent, and every event we sent back.

Open a request to read its body and response. Point webhook endpoints at your server, pick the events they receive, and switch them off without deleting them.

SDKs

Pick the SDK for where your code runs.

@bu-payment/node-sdk

For Node.js 20 and later. Signs each request with the versioned HMAC protocol and redacts its secret from strings, JSON, inspection and errors. ESM and CommonJS builds with TypeScript types.

bun add @bu-payment/node-sdk
Server SDK reference

@bu-payment/browser-sdk

For any front end, with no framework required. Catalogue, checkout and card saving, with automatic idempotency, resumable operations and typed events.

bun add @bu-payment/browser-sdk
Browser SDK reference

Get Test keys in a few minutes.

Create an account, open the Playground with your new App, and send your first request.