# SDK Reference

Official client libraries for integrating HivePay into your applications.

---

## Available SDKs

| Language | Package | Status |
|----------|---------|--------|
| TypeScript/JavaScript | `@hivepay/client` | Stable |
| PHP | `hivepay/client` | Stable |
| Python | Coming Soon | Planned |
| Go | Coming Soon | Planned |

---

## TypeScript SDK

The official TypeScript SDK provides a fully typed, promise-based API for interacting with HivePay.

### Features

- Full TypeScript support with comprehensive type definitions
- Promise-based API with async/await
- Native async iterators for pagination
- Built-in webhook verification
- Custom error types for easy error handling
- Zero dependencies (uses native fetch)
- Tree-shakeable ESM module
- Works in Node.js 18+ and modern browsers

### Quick Start

+++ TypeScript
```typescript
import { HivePay } from '@hivepay/client';

const hivepay = new HivePay({ apiKey: 'sk_live_xxx' });

// Create a payment
const payment = await hivepay.payments.create({
  amount: '10500',
  currency: 'HBD',
  description: 'Order #123'
});

// Redirect to checkout
window.location.href = payment.checkoutUrl;
```
+++ JavaScript
```javascript
const { HivePay } = require('@hivepay/client');

const hivepay = new HivePay({ apiKey: 'sk_live_xxx' });

const payment = await hivepay.payments.create({
  amount: '10500',
  currency: 'HBD',
  description: 'Order #123'
});
```
+++

---

## SDK Guides

[!ref icon="download" text="Installation"](/sdk/installation/)
[!ref icon="credit-card" text="Payments API"](/sdk/payments/)
[!ref icon="person" text="Merchants API"](/sdk/merchants/)
[!ref icon="number" text="Billing API"](/sdk/billing/)
[!ref icon="tools" text="Utilities"](/sdk/utilities/)
[!ref icon="alert" text="Error Handling"](/sdk/errors/)

---

## Requirements

### TypeScript SDK

| Requirement | Version |
|-------------|---------|
| Node.js | 18.0.0+ |
| TypeScript | 5.6+ (for development) |
| Runtime | Node.js or modern browser |

### Secure Context (Webhooks)

Webhook verification requires a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts) (HTTPS or localhost).

---

## Links

- [npm Package](https://www.npmjs.com/package/@hivepay/client)
- [GitHub Repository](https://github.com/hivepayment/hivepay)
- [TypeScript Definitions](https://www.npmjs.com/package/@hivepay/client?activeTab=code)
