CommetCommet
GitHubDiscordStatus
Introduction

Quickstart

Create an API KeyQuickstart

Learn

Resources

SDK ReferenceAPI VersioningError HandlingTestingCLIExamples

Plugins

Better Auth
DocumentationKnowledge BaseBuild with AIAPI ReferenceWebhooks

SDK Reference

Configuration, environments, and pagination

Setup

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

OptionTypeDefaultDescription
apiKeystringrequiredYour API key (starts with ck_). The org that owns the key decides whether calls run against sandbox or live data.
apiVersionstringversion the SDK release was built againstAPI version pin, sent as the Commet-Version header on every request. See API versioning.
debugbooleanfalseLog requests/responses
timeoutnumber30000Request timeout (ms)
retriesnumber3Max retry attempts
telemetrybooleantrueSend 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:

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.

const page = await commet.customers.list({ limit: 25 })

if (page.hasMore) {
  const nextPage = await commet.customers.list({ 
    limit: 25,
    cursor: page.nextCursor,
  })
}
ParameterTypeDefaultDescription
limitnumber25Items per page (max 100)
cursorstring-Cursor from previous response

How is this guide?

Dashboard Metrics and Usage Events

Understand MRR, revenue, churn, active subscriptions, and the usage-event explorer.

API Versioning

How Commet versions its API and webhooks so your integration never breaks unexpectedly.

On this page

Setup
Options
Sandbox vs live
Debug Mode
Pagination