Skip to main content
The Obiex Node.js SDK is a thin, typed wrapper around the REST API. It handles request signing (HMAC SHA-256), base URL selection, and response typing so you can focus on your integration rather than on the transport.

Requirements

  • Node.js 20+
  • An Obiex API key and secret. Generate them under Settings → Developers → API Keys in your account dashboard.

Installation

npm install obiex-api
yarn add obiex-api
pnpm add obiex-api

Quickstart

Instantiate ObiexClient once and reuse it across your application. The client signs every outbound request with your secret — you never have to compute the HMAC yourself.
import { ObiexClient } from 'obiex-api';

const client = new ObiexClient({
  apiKey: process.env.OBIEX_API_KEY!,
  apiSecret: process.env.OBIEX_API_SECRET!,
  sandboxMode: true, // false in production
});

// Your first call: fetch the currencies you can trade
const currencies = await client.getTradableCurrencies();

console.log(currencies.map(c => c.code));
All testing should be done with sandboxMode: true. No real funds move in the staging environment.

Configuration

The constructor accepts a single Options object:
OptionTypeRequiredDescription
apiKeystringYesYour API key from the dashboard.
apiSecretstringYesThe matching secret. Never expose this client-side.
sandboxModebooleanNoWhen true, requests go to staging. Defaults to false.
The client picks the correct base URL automatically:
EnvironmentsandboxModeBase URL
Stagingtruehttps://staging.api.obiex.finance
Productionfalsehttps://api.obiex.finance

Error handling

Failed requests throw a ServerError carrying the HTTP status and the API’s error payload. Catch and inspect it like any other typed error:
import { ObiexClient, ServerError } from 'obiex-api';

try {
  await client.withdrawCrypto('BTC', 999_999, {
    address: 'bc1q...',
    network: 'BTC',
  });
} catch (err) {
  if (err instanceof ServerError) {
    console.error('status:', err.statusCode); // e.g. 400
    console.error('payload:', err.data);      // structured API error
    return;
  }
  throw err;
}
Validation failures (4xx) and server errors (5xx) both surface as ServerError — branch on err.statusCode if you need to react differently.

What’s next

The SDK mirrors every domain in the API Reference. Pair the guides on the left with the matching client methods:

Collections (deposit addresses)

getDepositAddress, getDepositAddresses

Trading

createQuote, acceptQuote, trade, getTradePairs

Payouts

withdrawCrypto, withdrawNaira, getBanks

Invoice settlement

uploadInvoiceDocument, createInvoice, getInvoices
For the full method reference and the latest changelog, see the SDK on GitHub.

Without the SDK

You can call the API directly with any HTTP client — the SDK exists for convenience, not as a requirement. If you’d rather hand-roll the request signing (or you’re on a runtime the SDK doesn’t target), the Authentication page walks through the HMAC scheme step by step.