Skip to main content
@bobpayments/sdk is the recommended way to integrate in Node.js: zero dependencies (uses native fetch and node:crypto), TypeScript types for the full API contract, ESM + CJS.
Server-side only: the sk_live_/sk_test_ API key is secret and must never reach the browser.

Installation

Requires Node.js 20 or 22 (LTS).

Client

Create a checkout session (PIX)

Use the hosted checkout when you want Bob to present the payment screen. Today the available method is PIX; credit_card arrives when card is launched:
See the field details in Hosted checkout.

Create a PIX charge

Every create sends an Idempotency-Key header automatically, which makes the call safe to retry — the SDK retries with backoff on timeout, network failure, 429, and 5xx without risk of a duplicate payment.

Lookups

Webhooks

constructWebhookEvent verifies the signature (v1 and v2, in constant time, with anti-replay) and returns the typed event:
Payload and signature details: Webhooks.

Error handling

Every non-2xx response becomes a BobPaymentsApiError with the API’s RFC 7807 fields:

Sandbox

With sk_test_, the outcome in the sandbox is controlled by the amount’s cents — see Sandbox:

Next steps

Checkout SDK

Frontend layer: mount the checkout on your site with the session created here.

SDK overview

How the server libraries and the frontend SDK fit together.

Source code and releases

github.com/BobPayments/bob-payments-sdk-node — CHANGELOG and versions via semantic-release