> ## Documentation Index
> Fetch the complete documentation index at: https://commet.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Reference

> Configure the Commet Node.js SDK's API key, version, timeouts and retries, switch between sandbox and live, and paginate results.

## Setup

```typescript theme={null}
import { Commet } from '@commet/node'

const commet = new Commet({
  apiKey: process.env.COMMET_API_KEY!,
})
```

Get your API key from the dashboard under **Settings → API Keys**.

The installed package includes version-matched agent documentation at `node_modules/@commet/node/docs/README.md`. Run `commet doctor --output agent` to check the local SDK and configuration without changing files or contacting Commet.

## Options

| Option | Type | Default | Description |
| - | - | - | - |
| `apiKey` | string | required | Your full-access (`ck_`) or restricted (`rk_`) API key. The org that owns it decides whether calls run against sandbox or live data. |
| `apiVersion` | string | version the SDK release was built against | API version pin, sent as the `Commet-Version` header on every request. See [API versioning](https://commet.co/docs/api-versioning.md). |
| `debug` | boolean | `false` | Log requests/responses |
| `timeout` | number | `30000` | Request timeout (ms) |
| `retries` | number | `3` | Max retry attempts |
| `telemetry` | boolean | `true` | Send anonymous client info (SDK version, runtime, platform) with requests. Set to `false` to disable. |

## Sandbox vs live

There is a single API host, `commet.co`. Use an API key created in a sandbox organization while integrating; swap it for a key from a live organization when you go to production. No code change beyond the environment variable.

## Debug Mode

See all requests and responses:

```typescript theme={null}
const commet = new Commet({
  apiKey: process.env.COMMET_API_KEY!,
  debug: true,
})

// [Commet SDK] POST https://commet.co/api/v1/customers
// [Commet SDK] Response status: 200 OK
```

## Pagination

List endpoints use cursor-based pagination.

```typescript theme={null}
const page = await commet.customers.list({ limit: 25 })

if (page.hasMore) {
  const nextPage = await commet.customers.list({
    limit: 25,
    cursor: page.nextCursor,
  })
}
```

| Parameter | Type | Default | Description |
| - | - | - | - |
| `limit` | number | 25 | Items per page (max 100) |
| `cursor` | string | - | Cursor from previous response |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.