Home / Companies / Clerk / Blog / Post Details
Content Deep Dive

From setActive to finalize: Migrating Custom Auth Flows to Clerk Core 3

Blog post from Clerk

Post Details
Company
Date Published
Author
Roy Anger
Word Count
5,271
Language
English
Hacker News Points
-
Summary

Clerk Core 3 introduces significant updates to custom authentication flows, notably replacing the setActive() method with a new finalize() method for session activation in sign-in and sign-up processes. The beforeEmit callback is replaced by a navigate callback, which now includes a decorateUrl utility to ensure environment-aware URL transformations. The upgrade emphasizes the importance of using finalize() for new sessions and setActive() for switching between existing sessions or organizations. The guide provides detailed migration instructions, including code comparisons and highlights changes such as the introduction of a needs_client_trust status for unfamiliar device sign-ins, error handling improvements, and new hook shapes. Developers are encouraged to verify their configurations after using Clerk's upgrade CLI and to test their migrated flows in a development environment before deployment.