Skip to content

SDKs overview

Chat ships three TypeScript libraries for tenant applications. One runs in your backend, two run in your users’ browsers. Each has zero runtime dependencies and uses the Chat API’s own snake_case field names, so a message looks the same in all three.

The libraries are private packages on GitHub Packages under the @central-code-station scope. They are not on the public npm registry, and access is restricted.

  1. Get access. Contact your Central Code Station account contact to have your GitHub account or organization granted access to the packages.
  2. Create a token. Create a GitHub personal access token (classic) with the read:packages scope. Keep it out of source control.
  3. Point the scope at GitHub Packages. Add this to the .npmrc at your project root, and export the token as GITHUB_PACKAGES_TOKEN in your shell and in CI:
.npmrc
@central-code-station:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_TOKEN}

Instead of a variable, you can run npm login --scope=@central-code-station --registry=https://npm.pkg.github.com once and let npm keep the token in your user-level ~/.npmrc. Never commit a real token in a project .npmrc.

  1. Install what you need.
Terminal window
npm install @central-code-station/ccs-chat-client
npm install @central-code-station/ccs-chat-user-client
npm install @central-code-station/ccs-chat-notifications-client

If npm install answers 401 or 404 for a @central-code-station package, the token is missing, lacks read:packages, or has no access to the package. Ask your account contact.

Library Runs in Credential What it does
ccs-chat-client Your backend A backend client (client_credentials) with chat:sync or granular chat:* scopes Creates conversations, groups and channels, manages members, archives conversations, and sends messages on behalf of users or as SYSTEM messages.
ccs-chat-user-client Your web or mobile app The signed-in user’s Chat token, chat:access The user’s own calls: conversations, messages, reactions, read state, typing, presence and capabilities. Angular and React adapters.
ccs-chat-notifications-client Your web app The signed-in user’s Chat token, chat:access Realtime events over server-sent events, and web push. Angular and React adapters.

An integrated Chat setup uses all three: your backend decides who may talk to whom and creates the conversations, and your app reads, writes and listens as the user. ccs-chat-client holds a client secret, so it never runs in a browser. The two user-side libraries take the user’s token from a getAccessToken function you provide; your backend gets that token by token exchange.

Not using TypeScript, or not using an SDK? Call the REST API directly. See Use the REST API from any stack and Generate a client from OpenAPI.

ccs-chat-client ccs-chat-user-client ccs-chat-notifications-client
Node.js 20 or later 20 or later 20 or later
Browsers Not for browsers Any with fetch Realtime needs EventSource; push needs service workers and PushManager
Angular 17 or later, optional 17 or later, optional
React 18 or later, optional 18 or later, optional
RxJS 7, for the Angular adapter 7, for the Angular adapter
Entry points . ., /angular, /react ., /angular, /react, /push, /push/react

Angular, React and RxJS are optional peer dependencies. Install only what your app uses; the framework-free entry points need none of them. ccs-chat-user-client also runs in React Native. The notifications client does not support React Native.

Every entry point ships as both ES modules and CommonJS, with type declarations for each. import gets the ES build and require() gets the CommonJS build. Both work from ESM and CommonJS projects, with any bundler, and with TypeScript’s node16, nodenext, bundler and legacy node module resolution.

Load a library one way per app. The two builds are separate copies, so an instanceof check on an error from one build fails against the other.

The libraries follow semantic versioning and are released independently, so their version numbers do not match. Each release has its own tag, ccs-chat-client-v3.0.0 for example. A major version signals a breaking change. See the platform changelog, or one library’s changelog: ccs-chat-client, ccs-chat-user-client or ccs-chat-notifications-client.