Skip to content

Clerk backend v2#10268

Draft
djabarovgeorge wants to merge 1 commit intonextfrom
cursor/clerk-backend-v2-010e
Draft

Clerk backend v2#10268
djabarovgeorge wants to merge 1 commit intonextfrom
cursor/clerk-backend-v2-010e

Conversation

@djabarovgeorge
Copy link
Contributor

What changed? Why was the change needed?

This PR upgrades the @clerk/backend package from major version 1 to 2.

Key changes include:

  • Dependency Bumps:
    • @clerk/backend: ^1.25.2 -> ^2.33.0
    • @clerk/express: ^1.3.53 -> ^1.7.76 (compatible with @clerk/backend v2)
    • @clerk/testing: ^1.3.27 -> ^1.14.3 (compatible with @clerk/backend v2)
    • @clerk/types: Bumped to ^4.101.20 for consistency.
  • Code Migration:
    • Updated libs/testing/src/ee/clerk-client.mock.ts to derive OrganizationAPI and UserAPI types from ClerkClient as direct deep imports (@clerk/backend/dist/api/endpoints) are no longer exposed in v2.
    • Removed an unused OrganizationMembershipRole import from .source/auth/src/repositories/ee.member.repository.ts.

The upgrade was needed to move the project to the latest major version of @clerk/backend, ensuring all necessary migration steps were applied and existing JWT token behavior was preserved.

Screenshots

N/A

Expand for optional sections

Related enterprise PR

A corresponding branch cursor/clerk-backend-v2-010e has been pushed to novuhq/packages-enterprise. A PR will need to be created and merged there first.

Special notes for your reviewer

  • JWT Behavior: The project uses passport-jwt with jwks-rsa for JWT validation, which is independent of the @clerk/backend SDK version. The JwtPayload structure (including org_id, org_role, org_permissions) remains consistent.
  • Tests: All Clerk-related unit tests (ClerkStrategy and LinkEntitiesService) pass.
  • Compilation: All packages compile successfully after the upgrade.

Slack Thread

Open in Web Open in Cursor 

- @clerk/backend: ^1.25.2 -> ^2.33.0
- @clerk/express: ^1.3.53 -> ^1.7.76 (compatible with backend v2)
- @clerk/testing: ^1.3.27 -> ^1.14.3 (compatible with backend v2)
- @clerk/types: ^4.6.1/^4.48.0 -> ^4.101.20

Breaking changes addressed:
- Replaced dist/api/endpoints import in clerk-client.mock.ts with
  ClerkClient type derivation (v2 exports map restricts deep imports)
- Removed unused OrganizationMembershipRole import from ee.member.repository.ts

JWT behavior verified:
- JWT parsing uses passport-jwt with jwks-rsa directly (not Clerk SDK)
- JwtPayload type from @clerk/types still exports org_id, org_role,
  org_permissions, org_slug at the top level
- ClerkStrategy tests pass confirming JWT payload transformation is
  identical to v1

Co-authored-by: George Djabarov <djabarovgeorge@users.noreply.github.com>
@cursor
Copy link
Contributor

cursor bot commented Mar 12, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@netlify
Copy link

netlify bot commented Mar 12, 2026

Deploy preview added

Name Link
🔨 Latest commit d3624f3
🔍 Latest deploy log https://app.netlify.com/projects/dashboard-v2-novu-staging/deploys/69b29683e14fc10008aa7d3b
😎 Deploy Preview https://deploy-preview-10268.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Contributor

Hey there and thank you for opening this pull request! 👋

We require pull request titles to follow specific formatting rules and it looks like your proposed title needs to be adjusted.

Your PR title is: Clerk backend v2

Requirements:

  1. Follow the Conventional Commits specification
  2. As a team member, include Linear ticket ID at the end: fixes TICKET-ID or include it in your branch name

Expected format: feat(scope): Add fancy new feature fixes NOV-123

Details:
No release type found in pull request title "Clerk backend v2". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
    PR title must end with 'fixes TICKET-ID' (e.g., 'fixes NOV-123') or include ticket ID in branch name

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.

2 participants