From 23a9160d85317bd4339a2a1fa40e2255253eada4 Mon Sep 17 00:00:00 2001 From: Dylan Staley <88163+dstaley@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:45:00 -0800 Subject: [PATCH] feat(clerk-js): Allow persisting Clerk client options (#4662) --- .changeset/hungry-rivers-kiss.md | 2 ++ packages/clerk-js/sandbox/app.js | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 .changeset/hungry-rivers-kiss.md diff --git a/.changeset/hungry-rivers-kiss.md b/.changeset/hungry-rivers-kiss.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/hungry-rivers-kiss.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/clerk-js/sandbox/app.js b/packages/clerk-js/sandbox/app.js index a2602ca4e3..acf9bfbe62 100644 --- a/packages/clerk-js/sandbox/app.js +++ b/packages/clerk-js/sandbox/app.js @@ -9,6 +9,7 @@ */ const AVAILABLE_COMPONENTS = /** @type {const} */ ([ + 'clerk', // While not a component, we want to support passing options to the Clerk class. 'signIn', 'signUp', 'userButton', @@ -80,6 +81,7 @@ function buildComponentControls(component) { * @type {Record} */ const componentControls = { + clerk: buildComponentControls('clerk'), signIn: buildComponentControls('signIn'), signUp: buildComponentControls('signUp'), userButton: buildComponentControls('userButton'), @@ -176,6 +178,7 @@ function addCurrentRouteIndicator(currentRoute) { const renderCurrentRoute = routes[route]; addCurrentRouteIndicator(route); await Clerk.load({ + ...(componentControls.clerk.getProps() ?? {}), signInUrl: '/sign-in', signUpUrl: '/sign-up', });