Skip to main content
Integrate crypto payments into your Node.js application using the official XPayLabs Node.js SDK (@xpaylabs/node-sdk). The SDK provides typed API bindings for TypeScript and JavaScript with automatic HMAC signing, webhook verification, and full TypeScript type declarations.

Installation

The SDK requires Node.js 14+.

Configuration

OptionRequiredDefaultDescription
apiKeyYesMerchant token
apiSecretYesAPI secret for HMAC signing
baseUrlNohttps://api.xpaylabs.comGateway base URL (override for self-hosted deployments)
timeoutNo30000Request timeout in ms

Core API Methods

Create a Collection Order

Create a Payout

Query Order Status

Get Supported Symbols

Handling Webhooks

Use an Express.js endpoint to receive and verify webhook callbacks:
The webhook has built-in replay protection — events with timestamps older than 30 seconds are rejected.

Error Handling

TypeScript Support

The SDK ships with complete type declarations. Import the types directly:
The SDK handles HMAC-SHA256 signing internally — you don’t need to compute signatures manually. All POST requests are automatically wrapped in the ReqPayload envelope with sign, timestamp, and nonce.
Last modified on June 26, 2026