Skip to main content
@customergpt/sdk works in Node.js 18+, Bun, Deno, edge runtimes, and anywhere fetch exists. Keep it on your server: the API key must never reach a browser.

Install

Quick start

Create an API key under Role Permissions → Public API Keys in the dashboard. See Authentication.

Train on files

.pdf, .docx, .md, .txt and .csv files up to 10 MB:
data can also be a Blob or File, for example when your server forwards a user’s upload. To wait for everything a chatbot is training, including sources added in the dashboard:

Resources

Changes and dry runs

Methods that change data apply immediately; the SDK confirms them for you. Pass { dryRun: true } as the last argument to check a change without making it:

Errors

Failures throw CustomerGPTError with code, status, and often a hint. Errors from the server also carry requestId; quote it to support@customergpt.ai.
jobs.wait and knowledge.wait throw TRAINING_FAILED if training fails and WAIT_TIMEOUT on timeout. The error carries the last known job, so you can resume waiting.

Try without an account

The draft token is a secret. Drafts expire after 24 hours.

Configuration