Skip to content

docs(repo): Document Client Trust duration and cookieExpiresAt usage - #9350

Open
SarahSoutoul wants to merge 3 commits into
mainfrom
ss/DOCS-11777
Open

docs(repo): Document Client Trust duration and cookieExpiresAt usage#9350
SarahSoutoul wants to merge 3 commits into
mainfrom
ss/DOCS-11777

Conversation

@SarahSoutoul

@SarahSoutoul SarahSoutoul commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

Clarifies the ClientResource.cookieExpiresAt JSDoc so developers understand that it reports the client authentication cookie’s current expiration time, can change when Clerk refreshes the cookie, and can be null.

The updated documentation also explains that Device Trust uses the client cookie to recognize a known browser and links to the Device Trust guide.

An empty changeset is included because this is a documentation-only package change.

This fixes this ticket, with its sibling clerk-docs PR.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@SarahSoutoul SarahSoutoul self-assigned this Aug 6, 2026
@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8a815c4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
@clerk/shared Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/electron Patch
@clerk/expo-passkeys Patch
@clerk/expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/headless Patch
@clerk/hono Patch
@clerk/localizations Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/react Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/ui Patch
@clerk/vue Patch
@clerk/swingset Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview Aug 6, 2026 10:54pm
swingset Ready Ready Preview Aug 6, 2026 10:54pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Aug 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9350

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9350

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9350

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9350

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9350

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9350

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9350

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9350

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9350

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9350

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9350

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9350

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9350

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9350

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9350

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9350

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9350

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9350

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9350

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9350

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9350

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9350

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9350

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9350

commit: 8a815c4

@SarahSoutoul SarahSoutoul changed the title Document Client Trust duration and cookieExpiresAt usage docs(repo): Document Client Trust duration and cookieExpiresAt usage Aug 6, 2026
@SarahSoutoul
SarahSoutoul requested a review from manovotny August 6, 2026 14:41
@SarahSoutoul
SarahSoutoul marked this pull request as ready for review August 6, 2026 14:41
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-08-06T23:15:13.561Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on 8a815c4.

@SarahSoutoul
SarahSoutoul requested a review from mwickett August 6, 2026 14:45
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request clarifies the cookieExpiresAt documentation. It describes client authentication cookie refreshes, nullable values, and Device Trust usage. It also adds patch Changeset metadata.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: manovotny, mwickett

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the documentation update for cookieExpiresAt and its trust-related usage.
Description check ✅ Passed The description directly explains the JSDoc changes, Device Trust context, changeset, and related documentation work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

…geset

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@manovotny

manovotny commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Pushed a change directly in 4dcedc9.

  • Swapped the empty changeset for a @clerk/shared: patch one so this JSDoc clarification actually ships to consumers.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/tidy-client-cookie-docs.md:
- Line 5: Update the documentation for ClientResource.cookieExpiresAt to
describe it as the current expiration time of the client authentication cookie
used by Device Trust to recognize a known browser. Explicitly state that it is
nullable and may change when Clerk refreshes the client cookie, without implying
that the property contains the cookie itself.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 105813fd-4d6c-42fa-a69f-a9d29e72d073

📥 Commits

Reviewing files that changed from the base of the PR and between 2095a70 and 4dcedc9.

📒 Files selected for processing (1)
  • .changeset/tidy-client-cookie-docs.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual) → reviewed against open PR #3108 ss/DOCS-11777 instead of the default branch
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/clerk-ios (auto-detected)
  • clerk/clerk-android (auto-detected)
  • clerk/cli (auto-detected)

'@clerk/shared': patch
---

Clarify that `ClientResource.cookieExpiresAt` is nullable, can change when Clerk refreshes the client cookie, and reflects the cookie Device Trust uses to recognize a browser.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Describe cookieExpiresAt as an expiration time.

The implementation stores cookieExpiresAt as Date | null. The phrase “reflects the cookie” can imply that the property contains the cookie itself. State that it represents the current expiration time of the client authentication cookie used by Device Trust to recognize a known browser.

Proposed wording
-Clarify that `ClientResource.cookieExpiresAt` is nullable, can change when Clerk refreshes the client cookie, and reflects the cookie Device Trust uses to recognize a browser.
+Clarify that `ClientResource.cookieExpiresAt` is nullable, can change when Clerk refreshes the client cookie, and represents the current expiration time of the client authentication cookie used by Device Trust to recognize a known browser.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Clarify that `ClientResource.cookieExpiresAt` is nullable, can change when Clerk refreshes the client cookie, and reflects the cookie Device Trust uses to recognize a browser.
Clarify that `ClientResource.cookieExpiresAt` is nullable, can change when Clerk refreshes the client cookie, and represents the current expiration time of the client authentication cookie used by Device Trust to recognize a known browser.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/tidy-client-cookie-docs.md at line 5, Update the documentation
for ClientResource.cookieExpiresAt to describe it as the current expiration time
of the client authentication cookie used by Device Trust to recognize a known
browser. Explicitly state that it is nullable and may change when Clerk
refreshes the client cookie, without implying that the property contains the
cookie itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants