Major Changes
-
Consume packages with remotely hosted code removed as required by Manifest v3. (#4133) by @tmilewski
-
Permission Updates (BREAKING) (#4133) by @tmilewski
The
storageentry inhost_permissionsis now required for all extensions.
While it's likely that this is already enabled in your extension, this change is to ensure that Clerk can store the necessary data for the extension to function properly.How to Update: Add the following to your
manifest.jsonfile:{ "host_permissions": ["storage"] }Introducing
syncHost(BREAKING)In an effort to make the handling of sync hosts more deterministic, we have introduced a new parameter
syncHostto<ClerkProvider>How to Update: Replace
syncSessionWithTabwithsyncHostin the<ClerkProvider>component and setsyncHostto the host that you intend to synchronize with.Service Workers
createClerkClientWe've introduced a new method
createClerkClientto handle background tasks in your extension!import { createClerkClient } from '@clerk/chrome-extension/background'; // Create a new Clerk instance and get a fresh token for the user async function getToken() { const clerk = await createClerkClient({ publishableKey: process.env.PLASMO_PUBLIC_CLERK_PUBLISHABLE_KEY, }); return await clerk.session?.getToken(); } // Create a listener to listen for messages from content scripts // NOTE: A runtime listener cannot be async. // It must return true, in order to keep the connection open and send a response later. chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { // You can use the token in the listener to perform actions on behalf of the user // OR send the token back to the content script getToken().then(token => sendResponse({ token })); return true; });
Patch Changes
-
Introduce the
useReverification()hook that handles the session reverification flow: (#4536) by @panteliselef- Replaces
__experimental_useReverificationwithuseReverification
- Replaces
-
Updated dependencies [
4da28fa857d1e5538eb5bbe28ecc4bf9dba1ce7d,fe9e147e366153d664af7fc325655ecb299a1f9d,fe9e147e366153d664af7fc325655ecb299a1f9d,fe9e147e366153d664af7fc325655ecb299a1f9d,d84d7e31235c5c7da3415981dc76db4473a71a39,dce4f7ffca7248c0500f0ec9a978672b1f2fad69,7c27b0cfda6ace9693e9c184392481b00f24a64d]:- @clerk/clerk-js@5.35.0
- @clerk/clerk-react@5.17.0
- @clerk/shared@2.17.0