Getting Started
This SDK provides an easy interface to interact with the Wirex Pay API, including features like user management, card operations, transactions, wallet management, and action confirmation. The SDK also supports real-time WebSocket updates for changes such as cards or transactions updates.
Installation
Install the SDK via npm:
npm install wirex-pay-sdk
Setup and Initialization
To begin using the SDK, import the WirexPay class and initialize it with the necessary configuration options.
To obtain JWT API token please see Authorization.
Configuration Interface
interface IConfig {
token: string; // API token for authentication (required)
subscribeToSocket?: boolean; // Enable WebSocket subscription (optional)
socketUrl?: string; // WebSocket server URL (optional)
apiUrl?: string; // API base URL (optional)
}
Initializing WirexPay SDK
import { WirexPay } from 'wirex-pay-sdk';
const config = {
token: 'your-user-specific-token',
subscribeToSocket: true, // Enable real-time updates via WebSocket
};
WirexPay.init(config);
Updated 4 months ago