Skip to content

[EDU-2105] - Render both auth examples in examples page#2920

Merged
GregHolmes merged 3 commits intomainfrom
EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint
Feb 25, 2026
Merged

[EDU-2105] - Render both auth examples in examples page#2920
GregHolmes merged 3 commits intomainfrom
EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint

Conversation

@GregHolmes
Copy link
Contributor

Description

Checklist

@GregHolmes GregHolmes self-assigned this Oct 27, 2025
@GregHolmes GregHolmes added DRAFT Draft PR - do not review review-app Create a Heroku review app labels Oct 27, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 2025

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.

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
  • Post copyable unit tests in a comment
  • Commit unit tests in branch EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint

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-edu-2105-upda-4vwecg October 27, 2025 11:14 Inactive
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from 2fa8833 to 3c5aeb5 Compare October 27, 2025 11:58
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-4vwecg October 27, 2025 11:58 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-4vwecg October 27, 2025 12:08 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-4vwecg October 27, 2025 12:09 Inactive
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from d53fd73 to 35db3af Compare October 27, 2025 12:09
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-4vwecg October 27, 2025 12:09 Inactive
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from 35db3af to e071f69 Compare October 27, 2025 12:10
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-4vwecg October 27, 2025 12:10 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-4vwecg October 27, 2025 12:12 Inactive
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from de1dab6 to e3088cc Compare October 27, 2025 12:12
@GregHolmes GregHolmes changed the title DRAFT: [EDU-2105] - Update JWT auth example [EDU-2105] - Update JWT auth example Oct 27, 2025
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-4vwecg October 27, 2025 12:13 Inactive
@GregHolmes GregHolmes changed the title [EDU-2105] - Update JWT auth example [EDU-2105] - Render both auth examples in examples page Oct 27, 2025
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from e3088cc to 52f39b1 Compare October 27, 2025 15:22
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-4vwecg October 27, 2025 15:23 Inactive
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from 52f39b1 to 3a04d13 Compare November 4, 2025 09:05
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-sjytlb November 4, 2025 09:30 Inactive
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from 3a04d13 to 5b6adab Compare November 11, 2025 16:26
@GregHolmes GregHolmes added review-app Create a Heroku review app and removed review-app Create a Heroku review app labels Nov 11, 2025
@ably-ci ably-ci temporarily deployed to ably-docs-edu-2105-upda-guiyoc November 11, 2025 16:33 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-jofx5r November 12, 2025 10:02 Inactive
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch 3 times, most recently from 8c5fdc3 to 2fd278a Compare January 21, 2026 11:08
@GregHolmes GregHolmes added review-app Create a Heroku review app and removed review-app Create a Heroku review app labels Feb 23, 2026
@ably-ci ably-ci temporarily deployed to ably-docs-edu-2105-upda-iclapk February 23, 2026 11:03 Inactive
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from a309b5d to b10a0b2 Compare February 23, 2026 11:21
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-iclapk February 23, 2026 11:21 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-iclapk February 23, 2026 11:24 Inactive
@kennethkalmer kennethkalmer temporarily deployed to ably-docs-edu-2105-upda-iclapk February 23, 2026 12:07 Inactive
@kennethkalmer kennethkalmer temporarily deployed to ably-docs-edu-2105-upda-iclapk February 23, 2026 12:45 Inactive
@kennethkalmer kennethkalmer temporarily deployed to ably-docs-edu-2105-upda-iclapk February 23, 2026 12:56 Inactive
@kennethkalmer kennethkalmer temporarily deployed to ably-docs-edu-2105-upda-iclapk February 24, 2026 09:34 Inactive
@kennethkalmer kennethkalmer temporarily deployed to ably-docs-edu-2105-upda-iclapk February 24, 2026 13:51 Inactive
Copy link
Contributor

@m-hulbert m-hulbert left a comment

Choose a reason for hiding this comment

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

A few minor comments and we're there. Are we ably to raise the profile of the note about which method to prefer with an Aside or similar?

Authentication is the first step for an application to communicate with Ably. The application initializes a client and calls a predefined `authUrl` endpoint on your backend server. This endpoint uses an API key to request a JWT from Ably and returns it to the requesting client. When the JWT nears expiry, the `authUrl` is automatically invoked to request a new JWT.
Authentication is the first step for an application to communicate with Ably. The application initializes a client with an `authCallback` that fetches credentials from your backend server. This endpoint uses an API key to generate a JWT and returns it to the requesting client. When the JWT nears expiry, the `authCallback` is automatically invoked to request a new JWT.

Authentication is implemented using [Ably Pub/Sub](https://ably.com/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. It provides a set of flexible APIs capable of building any realtime application and is powered by Ably's reliable and scalable platform.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Authentication is implemented using [Ably Pub/Sub](https://ably.com/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. It provides a set of flexible APIs capable of building any realtime application and is powered by Ably's reliable and scalable platform.
Authentication is implemented using [Ably Pub/Sub](https://ably.com/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Authentication is the first step for an application to communicate with Ably. The application initializes a client and calls a predefined `authUrl` endpoint on your backend server. This endpoint uses an API key to request a token from Ably and returns it to the requesting client. When the token nears expiry, the `authUrl` is automatically invoked to request a new token.
Authentication is the first step for an application to communicate with Ably. The application initializes a client with an `authCallback` that fetches credentials from your backend server. This endpoint uses an API key to request a token from Ably and returns it to the requesting client. When the token nears expiry, the `authCallback` is automatically invoked to request a new token.

Authentication is implemented using [Ably Pub/Sub](/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. It provides a set of flexible APIs capable of building any realtime application and is powered by Ably's reliable and scalable platform.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Authentication is implemented using [Ably Pub/Sub](/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. It provides a set of flexible APIs capable of building any realtime application and is powered by Ably's reliable and scalable platform.
Authentication is implemented using [Ably Pub/Sub](/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products.

Copy link
Contributor Author

Choose a reason for hiding this comment

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


Authentication is implemented using [Ably Pub/Sub](/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. It provides a set of flexible APIs capable of building any realtime application and is powered by Ably's reliable and scalable platform.

> **Note:** For most use cases, [JWTs](/docs/auth/token#jwt) are the recommended authentication method. They enable you to issue credentials without making a request to Ably, reducing latency and server dependencies. Ably Tokens are primarily useful when you need to use the Ably SDKs on the server-side to generate tokens with specific capabilities.
Copy link
Contributor

Choose a reason for hiding this comment

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

So the only time we're pointing people to use Ably Tokens are:

  • Your capability list is too large and exceeds JWT size limits. JWTs must fit within HTTP header limits, typically around 8 KB.
  • You need to keep your capability list confidential, as JWTs can be decoded by clients.
  • You already have a JWT-based auth system and want to embed Ably tokens within your existing JWTs.

And I think we should be more firm with it - i.e. "Only use an Ably Token when:"

},
{
id: 'auth-request-token',
name: 'Request Token',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
name: 'Request Token',
name: 'Request an Ably Token',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-iclapk February 24, 2026 16:08 Inactive
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from fd12610 to 9753514 Compare February 24, 2026 16:08
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-iclapk February 24, 2026 16:08 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-iclapk February 24, 2026 16:10 Inactive
@GregHolmes GregHolmes requested a review from m-hulbert February 24, 2026 16:25
Copy link
Contributor

@m-hulbert m-hulbert left a comment

Choose a reason for hiding this comment

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

LGTM!

@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from 3f69b18 to 8894554 Compare February 24, 2026 16:50
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2105-upda-iclapk February 24, 2026 16:51 Inactive
@GregHolmes GregHolmes added review-app Create a Heroku review app and removed review-app Create a Heroku review app labels Feb 24, 2026
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from 8894554 to 5c335d0 Compare February 25, 2026 09:27
- auth-generate-jwt: Switch JavaScript and React clients to authCallback
- auth-request-token: Switch JavaScript and React clients to authCallback
- Fix ES module compatibility (__dirname) in both servers
- Change dotenv to load .env instead of .env.local
- Fix JWT response format (send as text, not JSON)
@GregHolmes GregHolmes force-pushed the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch from 5c335d0 to a5bf8c3 Compare February 25, 2026 09:59
@GregHolmes GregHolmes merged commit 4b341fc into main Feb 25, 2026
7 checks passed
@GregHolmes GregHolmes deleted the EDU-2105-Update-JWT-and-token-auth-examples-to-use-Ably-demo-endpoint branch February 25, 2026 10:08
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.

6 participants