Clerk SDK migration
Upgrade to Clerk Core 2: clerkMiddleware, async auth(), renamed redirect props.
1 repository · 3 migrations a month · no card
What compat detects
- @clerk/nextjs
- @clerk/clerk-react
- @clerk/backend
- @clerk/clerk-sdk-node
- @clerk/express
Clerk's Core 2 replaced authMiddleware with clerkMiddleware and made auth() async in v6, while the Node SDK moved to @clerk/backend. compat migrates the middleware, every auth() call site and the component props in one pull request.
What breaks across majors
- 01
authMiddleware to clerkMiddleware with createRouteMatcher; auth() became async in v6.
- 02
@clerk/clerk-sdk-node is deprecated in favour of @clerk/backend and @clerk/express.
- 03
Component prop renames: afterSignInUrl to fallbackRedirectUrl or forceRedirectUrl; appearance API changes.
- 04
Session claims and getToken() templates need re-checking against custom JWT templates.
Typecheck catches the async auth() change at every call site. Redirect behaviour needs a manual walkthrough, listed in the pull request.
What an authMiddleware to clerkMiddleware run looks like
Illustrativecompat rewrites the middleware with route matchers, awaits every auth() call, renames redirect props, and opens the pull request with a manual sign-in and redirect check. Illustrative; no public run recorded yet.
01
Detect
compat finds the Clerk packages your code imports and the upstream releases that affect them.
02
Migrate and verify
It edits only the affected code in a disposable sandbox, regenerates the lockfile, and runs your existing tests, type checks, lint and build where available.
03
Pull request
It opens a PR with the diff, verification results, warnings and manual steps. A person merges.
Questions
- Does compat merge the Clerk migration automatically?
- No. compat has no merge capability. It pushes a branch and opens a pull request with the diff, the recorded checks and any manual steps. A person on your team reviews and merges.
- Which checks run?
- Your repository's own: install, typecheck, lint, test and build where the scripts exist. Each is listed in the pull request as passed, failed or not run. A check that did not run is never shown as passed.
- Does compat need my production credentials?
- No. Migrations run in a disposable sandbox with your code and package manager, not your environment. Checks that need live credentials are reported as not run.
- How does compat know a release affects my repository?
- It watches the Clerk packages your code imports, reads new release notes, and judges relevance against the files that actually use the SDK. Irrelevant releases are dismissed with the reason; relevant ones become a proposal or, if you allow it, a run.