# SDK

> Official JavaScript / TypeScript SDK for the Cryptonly merchant API.

Cryptonly provides an official JavaScript / TypeScript SDK for server-side integrations.

The SDK helps you work with the merchant API faster by giving you a typed client for common operations such as invoice creation, withdrawals, and account access, without having to build raw HTTP requests manually.

It is designed for trusted backend environments only and uses your accounts API key to authorize requests.

You can install the package from npm as **`@cryptonly/sdk`**.

```bash
npm install @cryptonly/sdk
```

  <ExternalLinkCard title="GitHub" href="https://github.com/cryptonly-net/cryptonly-typescript-sdk" icon="github" />
  <ExternalLinkCard title="npm registry" href="https://www.npmjs.com/package/@cryptonly/sdk" icon="npm" />

## Quick start

```ts

const client = new Cryptonly({
  apiKey: process.env.CRYPTONLY_API_KEY!,
  defaultAccountId: process.env.CRYPTONLY_ACCOUNT_ID, // optional
});

const invoice = await client.invoice.create({
  amount: 100,
  fiatCurrencyCode: 'USD',
  description: 'Order #123',
  orderId: 'order_123',
});
```

## Related pages

- [API reference](https://docs.cryptonly.net/api-reference.md): The merchant API this client calls
- [Authorization](https://docs.cryptonly.net/api-reference/authorization.md): The API key the client sends
- [Invoices](https://docs.cryptonly.net/guides/invoices.md): Create a checkout payment
- [Withdrawals](https://docs.cryptonly.net/guides/withdrawals.md): Quote and commit a payout
