Skip to main content

Clerk Changelog

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

Send users from your native app to your web app, in a web view or their browser, without making them sign in again.

You can now open your web app from an iOS, Android, or Expo app with the user already signed in, without another sign-in or multi-factor prompt.

Most native apps include a few web pages, like account settings, a help center, or a feature you haven't built natively yet. Until now, opening one of those pages from your app sent the user to your sign-in page, even though they were already signed in to the app. With Native to Web SSO, the page opens through a one-time sign-in link that expires after 60 seconds.

You can use it in three ways:

  • Show the page in a web view, for pages that are part of your app.
  • Open the page in the user's default browser, to send them to your full web app.
  • Create the link yourself, to open it with your own code when neither of the other two fits.

When the user signs out of your app, Clerk also signs them out of the web sessions those links created, with a few exceptions.

Get started

Native to Web SSO is free in development instances. In production, your application needs the Pro or Business plan. Your web app must use the same Clerk instance as your native app.

  1. Update your app to Clerk iOS SDK 1.7.3, Clerk Android SDK 1.5.0, or @clerk/expo 4.17.0 or later.
  2. In the Clerk Dashboard, navigate to the Native applications page. Enable the Native API, if it isn't already, then turn on Native to Web SSO.
  3. Follow the guide for your platform to open your first page: iOS, Android, or Expo.
Contributors
Mike Pitre
Sean Perez
Sam Wolfand
Robert Soriano

Share this article

User search is faster on large applications, and you can now filter users by their metadata.

User search is faster on large applications, and you can now filter users by their metadata.

  • Search runs on a new search index: every search in the Dashboard, and the slowest searches from your backend.
  • Metadata filters work in the Dashboard and from your backend.

Faster search on large applications

Over the past year we shipped incremental optimizations to user search, but some queries stayed slow. We've now built a dedicated search index. At peak traffic, a query to the index takes a median of 19 milliseconds, and 99% of queries take under 250 milliseconds.

From your backend, we now serve the searches that would be slowest in our main database from the index. These are mostly partial-match searches on large applications. We serve their counts from the index too: counting the matches of a search on a large application could time out after 10 seconds, and those counts now return. Other searches still run in our main database, as fast as they did before. Over time, we'll serve more searches from the index.

The Users page in the Dashboard reads from the new index for every search, filter, and page. It also has these changes:

  • Results appear without waiting for the total. A search or filter counts its matches up to 1,000 and shows 1,000+ beyond that.
  • Search no longer needs at least three characters.

Filter users by metadata

Metadata is where you keep your own data about a user, like a plan, a customer ID from your billing system, or an internal flag. Until now you could store that data on a user but not search by it.

The Dashboard Users page has a new Metadata filter. Choose public, private, or unsafe metadata, enter a key, and filter for users whose value for that key is or is not the one you enter. With an empty value, is matches users who have the key, and is not matches users who don't. You can combine several conditions in one filter.

As you type a key, the Dashboard suggests keys from the metadata your users already have, including nested keys such as onboarding.completed, with the number of users who have each one. On large applications, those numbers come from a sample of 5,000 users.

See Filter users by metadata for the steps.

How to get it

The faster search and the Metadata filter are live now for every application. Your existing Backend API calls and SDK methods get the faster search with no changes.

To filter by metadata from your backend, or to skip the total, upgrade to @clerk/backend v3.32.0 or clerk-sdk-go v2.10.0. They add two methods:

  • getUserListWithoutCount() and user.ListWithoutCount return the same page of users as getUserList() and user.List, without the total. The existing methods return an exact total with every page and wait for it, and over many users that total can take much longer than the page. Use these when you don't need the total.
  • searchUsers() and user.Search accept metadata filters and page by cursor, so they also suit exports and syncs that read every user. Their results can trail a recent change by a short time.
const { data, cursor } = await clerkClient.users.searchUsers({
  metadata: [{ scope: 'public', key: 'plan', match: 'equals', value: 'pro' }],
})
page, err := user.Search(ctx, &user.SearchParams{
	Metadata: []user.SearchMetadataFilter{
		{Scope: "public", Key: "plan", Match: "equals", Value: clerk.String("pro")},
	},
})
Contributors
Daniel Moerner
Graham Allan
Henry Snopek
Georgios Komninos

Share this article