Skip to content

[DX-631] Pub/Sub JavaScript SDK API references (realtime interface)#3400

Open
m-hulbert wants to merge 15 commits into
mainfrom
dx-631-pubsub-js
Open

[DX-631] Pub/Sub JavaScript SDK API references (realtime interface)#3400
m-hulbert wants to merge 15 commits into
mainfrom
dx-631-pubsub-js

Conversation

@m-hulbert

Copy link
Copy Markdown
Contributor

Description

This PR proposes a new format for the Pub/Sub JavaScript SDK (realtime interface) API references.

It uses the new components and design for API references introduced for the Chat API refs, updates the content to the latest SDK version (2.22.1) and tidies up anything that was legacy.

It also introduces a slightly new IA to better group like APIs, and ensures a better blend between the actual interface names used by the SDK (e.g. RealtimeChannel) and the concepts themselves (e.g. 'Channels').

For now, this doesn't update any links or remove the existing API references. This will follow once REST is complete for JavaScript, as we'll need to update the query param behaviour for API reference links. 1

Checklist

m-hulbert and others added 14 commits June 9, 2026 09:36
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@m-hulbert m-hulbert self-assigned this Jun 9, 2026
@m-hulbert m-hulbert added the review-app Create a Heroku review app label Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 80c84e1b-d12d-4eb7-acef-5fbc2953411f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dx-631-pubsub-js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ably-ci ably-ci temporarily deployed to ably-docs-dx-631-pubsub-ww6bte June 9, 2026 08:38 Inactive
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@@ -0,0 +1,278 @@
---
title: Auth

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just read through the auth page, it's infinitely better than what we originally had! The default values and even some side effects are way easier to understand.

Just a couple of notes that are probably only relevant for this page... "Auth" is both a concept and an interface, so I think we need to be stronger in the intro when framing what is and isn't on this page i.e. I think we should lead with JWTs more strongly and then highlight this page is largely only relevant if you're using the other auth types


The `Auth` interface is responsible for managing tokens and [authentication](/docs/auth) for an Ably client. Access it via the `auth` property of a [`Realtime`](/docs/pub-sub/api/javascript/realtime/realtime-client) client instance.

The principal use of `Auth` is to create Ably `TokenRequest`s with `createTokenRequest()`, or to obtain Ably Tokens from Ably with `requestToken()`, and then issue these short-lived tokens to less-trusted clients. Typically, your servers should be the only devices to hold the [private API key](/docs/auth#api-keys), which is used to sign Ably `TokenRequest`s or request Ably Tokens. If you adopt this model, your private API key is never shared with clients directly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TokenRequests formats weirdly... the old prose of "TokenRequest objects" reads nicer


The `Auth` interface is responsible for managing tokens and [authentication](/docs/auth) for an Ably client. Access it via the `auth` property of a [`Realtime`](/docs/pub-sub/api/javascript/realtime/realtime-client) client instance.

The principal use of `Auth` is to create Ably `TokenRequest`s with `createTokenRequest()`, or to obtain Ably Tokens from Ably with `requestToken()`, and then issue these short-lived tokens to less-trusted clients. Typically, your servers should be the only devices to hold the [private API key](/docs/auth#api-keys), which is used to sign Ably `TokenRequest`s or request Ably Tokens. If you adopt this model, your private API key is never shared with clients directly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the aside is too low down and also doesn't necessarily highlight that this page is largely irrelevant if you do use JWTs...

I think the intro itself could be reframed to something like:

The principal use of Auth is to issue short-lived credentials to less-trusted clients without sharing your private API key. The recommended approach for most applications is Ably JWTs, which let your server mint tokens using standard JWT libraries - examples can be seen here.

Ably also supports signed TokenRequests... blah blah blah... details below

@@ -0,0 +1,760 @@
---
title: RealtimeChannel

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ordering on this page is a little strange imo... I'd expect to see all the channel-centric operations first e.g. attaching, listeners, etc.. first, followed by all the message operations e.g. history, append, etc...

@m-hulbert m-hulbert requested a review from ttypic June 9, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

3 participants