Configuration
BucksBoxClient Options
const { BucksBoxClient } = require('@bucksbox/sdk');
const client = new BucksBoxClient({
gatewayUrl: 'https://api.bucksbox.in/gateway', // required — staging: https://api.bucksbox.in/gateway-stage
paymentSystemUrl: 'https://<paymentSystem-host>', // required — ask your integration contact, not fixed in this documentation set
clientId: 'your-client-id', // required
aesKey: 'your-64-char-hex-aes-256-key', // required
checksumSecret: 'your-hmac-secret', // required
token: 'existing-jwt', // optional — skip login
timeout: 30000, // optional — ms, default 30000
});
| Option | Type | Required | Description |
|---|---|---|---|
gatewayUrl | string | Yes | fintech-gateway base URL — production https://api.bucksbox.in/gateway, staging https://api.bucksbox.in/gateway-stage |
paymentSystemUrl | string | Yes | paymentSystem base URL |
clientId | string | Yes | Issued by your aggregator |
aesKey | string | Yes | 64 hex-char AES-256 key (32 bytes) |
checksumSecret | string | Yes | HMAC-SHA256 signing secret |
token | string | No | Pre-existing JWT — skips auth.login() |
timeout | number | No | Request timeout in ms (default: 30000) |
Token Management
// Login stores the token automatically
await client.auth.login({ email, password });
// Replace token manually (e.g. after token refresh)
client.setToken(newToken);
// Clear on logout
client.clearToken();
Environment Example
Store credentials in environment variables — never hard-code them:
const client = new BucksBoxClient({
gatewayUrl: process.env.BUCKSBOX_GATEWAY_URL,
paymentSystemUrl: process.env.BUCKSBOX_API_URL,
clientId: process.env.BUCKSBOX_CLIENT_ID,
aesKey: process.env.BUCKSBOX_AES_KEY,
checksumSecret: process.env.BUCKSBOX_CHECKSUM_SECRET,
});