Getting started
The GetChat Node.js SDK creates signed chat links and calls the REST API from your server. It ships with TypeScript types and supports both ESM and CommonJS.
The package is named @emby-chat/node-sdk and the client class is named Emby: these names remain from the previous product name for compatibility.
Install
Use Node.js 20 or newer.
pnpm add @emby-chat/node-sdk
Configure the client
import { Emby } from '@emby-chat/node-sdk';
const emby = new Emby({
api_token: process.env.EMBY_API_TOKEN,
api_url: 'https://api.getchat.io',
base_url: 'https://app.getchat.dev',
});
For CommonJS, use const { Emby } = require('@emby-chat/node-sdk') instead.
| Setting | Purpose |
|---|---|
api_token | Tenant API token for REST requests |
api_url | API host; defaults to base_url |
base_url | Chat UI host used for signed links |
id, secret | Client ID and signing secret for chat links |
options | Request timeouts and retry settings |
Pass a host without /api/v1 in api_url: the SDK adds that prefix. Keep the token and signing secret on your server.
Only provide credentials for the features you use. REST calls need the API token; signed links need id, secret and base_url. You can reuse one client across requests.
Make the first request
const result = await emby.getChats({ page: 1, limit: 20 });
for (const id of result.chats_sort) {
console.log(id, result.chats[id].title);
}
Pass limit explicitly: getChats() defaults to a single chat. For complete lists, use an iterator.
Choose how to call the API
| API | Use it for |
|---|---|
emby.getChats(), emby.sendMessage() and other convenience methods | Common tasks with stable signatures and input normalization |
emby.api.chatList(), emby.api.chatSendMessage() and other generated methods | Full endpoint coverage and strict OpenAPI inputs |
Both use the same transport and validate request inputs. Response bodies are returned without runtime validation.
Continue with working with the API, errors and retries, or the API reference.