Skip to main content
The @oaknetwork/payments-sdk package is a TypeScript SDK that wraps the Oak Network payment API — handling authentication, retries, and type safety so you can focus on building your integration.
Get your API credentialsTo start building with the SDK, you need a Client ID and Client Secret. Reach out to support@oaknetwork.org to get your sandbox credentials and start integrating today.

Highlights

  • Initialize a client for sandbox or production: createOakClient({ environment: 'sandbox', ... })
  • Standalone service factories — import only what you need: createCustomerService(client), createPaymentService(client), etc.
  • Type-safe results on every call: every method returns Result<T, OakError> — no uncaught exceptions
  • Built-in retry with exponential backoff, jitter, and Retry-After header support
  • Webhook signature verification built in: verifyWebhookSignature() and parseWebhookPayload()
  • Two environments out of the box: sandbox and production, plus customUrl for self-hosted setups

Quick example

See the full walkthrough in the Quickstart guide.

Services

The SDK ships 16 service modules. Import the factory function for each service you need.

Next up

  • Installation — install the package and configure credentials
  • Quickstart — your first working integration in under 5 minutes
  • Error Handling — understand the Result<T> pattern and error types