Skip to main content
Use these instructions to install, authenticate and instantiate the Chat SDK.

Authentication

Chat requires an authenticated client with a clientId to identify users. The recommended approach is:
  1. Client-side apps (browsers, iOS, Android): Use JWT authentication with authCallback to fetch JWTs from your server
  2. Server-side apps (Node.js, Python, etc.): Use your API key directly
Sign up to Ably to create an API key in the dashboard or use the Control API to create an API key programmatically.

Install

The Chat SDK is built on top of the Ably Pub/Sub SDK and uses that to establish a connection with Ably.
Install the Pub/Sub SDK and the Chat SDK:Import the SDKs into your project:

Instantiate a Client

Authentication is configured on the Ably Pub/Sub client, which the Chat client wraps. The Chat SDK itself doesn’t handle authentication directly - it uses the authenticated connection from the underlying Pub/Sub client. Use token authentication for browsers and mobile apps:

Server-side Authentication

For server-side applications or local development, you can use an API key directly:

Next Steps

Build docs developers (and LLMs) love