---
updatedAt: 2025-04-21T20:01:09.000Z
agentTools:
  projectIndex: https://partner.wirexpaychain.com/llms.txt
---

# 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:

```bash
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](https://partner.wirexpaychain.com/docs/authorization#option-2---by-using-the-authorize-user-method).

### **Configuration Interface**

```typescript
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**

```typescript
import { WirexPay } from 'wirex-pay-sdk';

const config = {
  token: 'your-user-specific-token',
  subscribeToSocket: true, // Enable real-time updates via WebSocket
};

WirexPay.init(config);

```