Skip to content

Add an internal session token signal hook#8472

Draft
jacekradko wants to merge 1 commit intomainfrom
codex/review-usetoken-signals-hook
Draft

Add an internal session token signal hook#8472
jacekradko wants to merge 1 commit intomainfrom
codex/review-usetoken-signals-hook

Conversation

@jacekradko
Copy link
Copy Markdown
Member

Summary

  • Add an instance-owned session token signal on Clerk state and wire it from active-session token updates
  • Expose __internal_useToken() through @clerk/react/internal via useSyncExternalStore without fetching token on mount
  • Add coverage for unloaded, signed-out, signed-in, rerender, and token update paths, plus an empty changeset

Testing

  • pnpm --filter @clerk/clerk-js test src/core/__tests__/state.test.ts src/core/resources/__tests__/Session.test.ts src/core/__tests__/clerk.test.ts
  • pnpm --filter @clerk/react test src/hooks/__tests__/useToken.test.tsx
  • pnpm --filter @clerk/clerk-js build:declarations
  • pnpm --filter @clerk/react build:declarations
  • Prettier and targeted ESLint checks passed on touched files

@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment May 5, 2026 3:11am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

🦋 Changeset detected

Latest commit: 07aa19f

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

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant