Skip to content

feat(clerk-js,react): Add js prop for bundled clerk-js support#7779

Open
jacekradko wants to merge 3 commits intojrad/ui-prop-cleanupfrom
jrad/js-prop-bundling
Open

feat(clerk-js,react): Add js prop for bundled clerk-js support#7779
jacekradko wants to merge 3 commits intojrad/ui-prop-cleanupfrom
jrad/js-prop-bundling

Conversation

@jacekradko
Copy link
Member

Summary

  • Introduces a js prop for ClerkProvider that mirrors the ui prop approach
  • Allows bundling clerk-js with the application instead of loading from CDN
  • Server-safe via react-server conditional export

Changes

@clerk/clerk-js:

  • New ./bundled export with branded js object containing ClerkJS constructor
  • New ./entry export for dynamic imports
  • New ./internal export for the Js type
  • react-server condition exports server-safe marker (no browser code)

@clerk/react:

  • Added js prop to ClerkProviderProps
  • Updated isomorphicClerk to handle js prop loading

Usage

import { js } from '@clerk/clerk-js/bundled';

<ClerkProvider js={js}>
  ...
</ClerkProvider>

Test plan

  • Verify pnpm build passes for clerk-js and react packages
  • Test bundled import in a Next.js app (both client and server components)
  • Verify CDN fallback still works when js prop is omitted

🤖 Generated with Claude Code

Introduces a js prop for ClerkProvider that mirrors the ui prop approach:

- @clerk/clerk-js/bundled exports branded js object with ClerkJS constructor
- react-server condition exports server-safe marker (no browser code)
- @clerk/clerk-js/entry provides entry point for dynamic imports
- ClerkProvider accepts js prop and handles loading appropriately

Usage:
```tsx
import { js } from '@clerk/clerk-js/bundled';

<ClerkProvider js={js}>
  ...
</ClerkProvider>
```
@vercel
Copy link

vercel bot commented Feb 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 Feb 6, 2026 4:21am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

⚠️ No Changeset found

Latest commit: 562c91e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

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

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a 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