The TypeScript SDK is coming soon. This page previews the planned interface.
Install
npm install @eqx/sdk
# or
pnpm add @eqx/sdk
Initialize
import { EqxClient } from '@eqx/sdk';
const eqx = new EqxClient({
apiKey: process.env.EQX_API_KEY,
baseUrl: 'https://api.eqxpay.io', // optional, defaults to production
});
Example: create a payout
// 1. Create a quote
const quote = await eqx.quotes.create({
market: 'KE',
sourceAsset: 'USDC',
sourceAmount: '100.00',
payoutMethod: 'MOBILE_MONEY',
beneficiaryId: 'ben_01J5K2M3N4P5Q6R7S8T9',
});
// 2. Commit the transaction
const transaction = await eqx.transactions.commit({
quoteId: quote.quoteId,
beneficiaryId: 'ben_01J5K2M3N4P5Q6R7S8T9',
}, {
idempotencyKey: crypto.randomUUID(),
});
console.log(transaction.status); // 'PROCESSING'
Webhook verification helper
import { verifyWebhookSignature } from '@eqx/sdk/webhooks';
app.post('/webhooks/eqx', (req, res) => {
const valid = verifyWebhookSignature(
req.rawBody,
req.headers['x-eqx-signature'],
process.env.EQX_WEBHOOK_SECRET,
);
if (!valid) return res.status(401).end();
const { event, payload } = req.body;
// handle event...
res.status(200).end();
});