Skip to main content

Clerk Changelog

A configurable grace period lets an OAuth or MCP client retry a refresh after a dropped response without the user authorizing it again.

You can now set a refresh token grace period of up to 60 seconds, so an OAuth or MCP client can recover from a dropped refresh response without the user authorizing it again.

Clerk replaces an OAuth refresh token every time a client uses it. If the response never reaches the client, for example because the network dropped, the client retries with the token it just used. Until now, Clerk treated that retry as token reuse and revoked the client's access, so the user had to authorize the client again. This is a common reason MCP clients ask users to reconnect.

Within the grace period after a refresh, Clerk accepts the previous refresh token once more and returns a new pair of tokens.

  • The setting applies to every OAuth application on the instance, including clients registered through Client ID Metadata Documents and dynamic client registration. Applications using Clerk's legacy OAuth implementation don't support it.
  • Clerk accepts only the refresh token that the most recent refresh replaced, and only once. Older refresh tokens still count as reuse and revoke the client's access.
  • New instances start with a grace period of 30 seconds. Existing instances are unchanged: each refresh token can be used only once until you turn the grace period on.

Get started

  1. In the Clerk Dashboard, navigate to the OAuth applications page and select the Settings tab.
  2. Under Refresh tokens, turn on Refresh token grace period and set a number of seconds between 1 and 60. Clerk recommends 30.
  3. Select Save.

You can also set it through the Backend API with the Clerk CLI:

npx clerk@latest api instance/oauth_application_settings -X PATCH -d '{"refresh_token_rotation_grace_period":30}'

If you use Clerk's MCP server to set up your own, configure_mcp_server sets a 30-second grace period when it registers the first MCP server on an instance that has none. If the instance still has none, check_mcp_server recommends one.

Contributor
Daniel Moerner

Share this article

3072-bit signing keys for new applications

Category
Security
Published

New applications now sign tokens with a 3072-bit RSA key.

Every new Clerk application now gets a 3072-bit RSA signing key instead of a 2048-bit one. Clerk signs session tokens and JWT template tokens with this key. When you create a production instance from a development instance, it keeps the development instance's key size. Existing instances keep their current key.

This key size follows the NSA's guidance on preparing for post-quantum cryptography, which accepts 3072-bit RSA as an interim choice. Clerk-managed signing keys have always used RSA, not the 256-bit elliptic-curve algorithms, such as ES256, that the guidance discourages. Connections to Clerk already support post-quantum key exchange over TLS 1.3, which current versions of all major browsers use by default.

The algorithm is still RS256, so the alg value in your instance's JWKS doesn't change. Signatures are longer, so each token is about 170 characters longer.

Compatibility

Clerk SDKs verify tokens through your instance's JWKS by default. Every version of @clerk/backend since 1.0.0 supports 3072-bit keys there, as do Clerk's Go, Python, Ruby, Java, C#, and PHP SDKs.

If you verify tokens without a network call by setting jwtKey or CLERK_JWT_KEY, you need @clerk/backend 3.36.0 or later on 3.x, or 2.35.0 or later on 2.x. On an earlier version, update your Clerk SDK or remove the pinned key. If you set CLERK_JWT_KEY, npx clerk@latest doctor checks this for you. See Manual JWT verification for details.

With the longer signature, check that session tokens with large custom claims still fit the 4KB cookie size limit.

What's next

We'll add a Dashboard option that lets you rotate your existing application's signing keys yourself.

Once that's in place, we'll move on to post-quantum signatures and release SDK updates to support them.

Contributor
Dominic Couture

Share this article

Migrate users to Clerk with the CLI

Category
Product
Published

Move users from Auth0, Auth.js, Better Auth, Firebase, Supabase, WorkOS, or any other platform into Clerk with clerk migrate and the new clerk-migrate skill.

The Clerk CLI can now migrate users from other platforms into Clerk. clerk migrate export pulls users out of your current platform, and clerk migrate import checks each one against your instance before it creates anything. The new clerk-migrate skill gives your agent the same commands, so it can run the migration for you or write a source for a platform the CLI doesn't support yet.

Get the latest CLI and skills

clerk migrate ships in Clerk CLI 4.2.0 and later. Update the CLI, or install it if you haven't yet:

# Update an existing install
clerk update

# Or install it globally
npm install -g clerk

Install Clerk's skills to get clerk-migrate:

npx skills add clerk/skills

If you already have Clerk's skills, add the new one with npx skills add clerk/skills --skill clerk-migrate.

Migrate with your agent

Ask your agent to migrate your users to Clerk. The skill exports your users, runs a dry run against your instance, and shows you what the checks found. It imports only after you approve.

Try prompts like:

  • "Migrate my users from Supabase to Clerk"
  • "Write a migration source for this user export"

Migrate from a supported platform

The CLI exports from Auth0, Auth.js, Better Auth, Firebase, Supabase, WorkOS, and other Clerk instances. To run a migration yourself, sign in with clerk auth login and clerk link, or set CLERK_SECRET_KEY to the Secret Key of the instance you're importing into. Then run:

clerk migrate export supabase                  # prints a run ID
clerk migrate import <export_run_id> --dry-run # checks, writes nothing
clerk migrate import <export_run_id> --yes     # imports

A development instance holds 100 users by default, and the dry run checks the import against it. Production has no limit: add --instance prod to both import commands, or use your production instance's Secret Key.

Supabase, Firebase, and Better Auth exports carry password hashes, so those users keep their passwords. Each platform's migration guide lists the exceptions. clerk migrate sources shows what each source carries, including passwords and MFA.

The import records every user's outcome, and running the same command again continues a run that stopped partway. clerk migrate runs shows what each run did, and clerk migrate undo <import_run_id> deletes the users an import created.

Migrate from any other platform

For a platform without a built-in source, give your agent the export file and ask it to write a Clerk migration source. The skill asks how your platform records email verification and hashes passwords, writes the source, and checks it with clerk migrate sources.

To write the source yourself, create a .ts or .js file in your project that maps your export's fields onto Clerk's user schema, then pass its path:

clerk migrate sources ./my-platform.ts
clerk migrate import users.json --source ./my-platform.ts --dry-run

See Write a custom source for the source format.

Get started

See the migration guides for each platform's export steps.

Contributors
Roy Anger
Michael Novotny

Share this article

Expo native components are now stable

Category
SDK
Published

@clerk/expo-native-components 1.0 is out of beta, with bug fixes and improvements to session sync.

The Expo native components are out of beta with @clerk/expo-native-components 1.0. This release also includes bug fixes and improvements to how sessions sync between JavaScript and the native components.

Upgrade

Upgrade @clerk/expo and @clerk/expo-native-components together, then rebuild your app:

npx expo install @clerk/expo @clerk/expo-native-components

@clerk/expo now requires @clerk/expo-native-components 1.0.0 or later. If your app's native build comes from an older version, for example when an over-the-air update ships a newer @clerk/expo without a rebuild, @clerk/expo disables the native components and logs an error that explains the mismatch. Give the new build a new runtime version so over-the-air updates with this upgrade only reach builds that include it.

See the native components overview to get started, and the theming reference to match them to your app's design.

Contributors
Mike Pitre
Sean Perez
Sam Wolfand
Robert Soriano

Share this article

Protect events in Application Logs now show the decision behind them, including the protection or rule that made it.

Application Logs in the Dashboard now show the decision behind Clerk Protect events. When you select a Protect event whose payload has a trace_id, such as protect.sign_up.blocked or protect.sign_in.challenged, its details include a Protect decision section with:

  • The outcome, such as Blocked or Challenged
  • The protection or rule that made the decision
  • The request type, network, and country

When a blocked user sees Clerk's screen with a reference code, that code is the trace_id in the event's payload. A user can send you their code, and you can find the event and see which protection or rule blocked them.

Read Protect decisions to learn more.

Contributor
Mike Wickett

Share this article