Skip to content

Document Chat user claims (userClaim)#3226

Merged
AndyTWF merged 4 commits intomainfrom
chat-user-claims
Feb 24, 2026
Merged

Document Chat user claims (userClaim)#3226
AndyTWF merged 4 commits intomainfrom
chat-user-claims

Conversation

@AndyTWF
Copy link
Contributor

@AndyTWF AndyTWF commented Feb 24, 2026

Summary

  • Adds a dedicated "User claims" section to the Chat SDK setup page (/docs/chat/setup) explaining how to set room-scoped JWT claims (ably.room.<roomName>) and read the userClaim field from events
  • Adds userClaim to property tables for messages, presence, typing indicators, room reactions, and message reactions
  • Updates the Chat REST API OpenAPI spec to include the userClaim field on the Message schema

Corresponds to SDK PR: ably/ably-chat-js#711

Test plan

  • Review the "User claims" section on /docs/chat/setup renders correctly (JS/React language tabs)
  • Verify userClaim rows appear in property tables on messages, presence, typing, and reactions pages
  • Confirm the REST API spec at /docs/api/chat-rest shows the userClaim field on the Message schema
  • Check all internal links resolve correctly (#user-claims, #set-user-claims)

🤖 Generated with Claude Code

CHA-1243

Add a dedicated "User claims" section to the Chat setup page explaining
how to set room-scoped JWT claims and read the userClaim field from events.
Add userClaim to property tables for messages, presence, typing, room
reactions, and message reactions. Update the Chat REST API OpenAPI spec
to include the userClaim field on the Message schema.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AndyTWF AndyTWF added the review-app Create a Heroku review app label Feb 24, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

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 chat-user-claims

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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ably-ci ably-ci temporarily deployed to ably-docs-chat-user-cla-qhocd7 February 24, 2026 16:19 Inactive
@AndyTWF AndyTWF requested a review from m-hulbert February 24, 2026 16:19
@AndyTWF AndyTWF added review-app Create a Heroku review app and removed review-app Create a Heroku review app labels Feb 24, 2026
@ably-ci ably-ci temporarily deployed to ably-docs-chat-user-cla-capinu February 24, 2026 16:28 Inactive
@AndyTWF AndyTWF added review-app Create a Heroku review app and removed review-app Create a Heroku review app labels Feb 24, 2026
@ably-ci ably-ci temporarily deployed to ably-docs-chat-user-cla-h35vdq February 24, 2026 16:42 Inactive
@m-hulbert m-hulbert temporarily deployed to ably-docs-chat-user-cla-v7duqd February 24, 2026 16:52 Inactive
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ably-ci ably-ci temporarily deployed to ably-docs-chat-user-cla-2ke3dv February 24, 2026 17:01 Inactive

### User claims <a id="user-claims"/>

<If lang="javascript,react">
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this go before the heading, otherwise it'll be an empty header for Kotlin/Swift.

The `userClaim` value is always a string. If you encode a JSON object in the claim, you must parse it on the client. The value is only present if the publishing user's token contained a matching claim for the room.
</Aside>

For more details on how user claims work at the platform level, including channel-scoped claims and matching rules, see the [custom restrictions](/docs/auth/capabilities#custom-restrictions) documentation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary? I feel you've covered everything here related to Chat.

- Move <If lang> before heading so user claims section is hidden entirely
  for non-JS/React languages (no empty header)
- Remove redundant link to custom restrictions docs
- Update typing.currentTypers for JS/React only, keep typing.current for
  Swift/Kotlin/Android
- Add React code sample for currentTypers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ably-ci ably-ci temporarily deployed to ably-docs-chat-user-cla-yvttsn February 24, 2026 17:19 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.

LGTM

@AndyTWF AndyTWF marked this pull request as ready for review February 24, 2026 17:37
@AndyTWF AndyTWF merged commit abe89a6 into main Feb 24, 2026
7 checks passed
@AndyTWF AndyTWF deleted the chat-user-claims branch February 24, 2026 17:37
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