diff --git a/.changeset/calm-wasps-accept.md b/.changeset/calm-wasps-accept.md new file mode 100644 index 00000000000..88c309b7aa9 --- /dev/null +++ b/.changeset/calm-wasps-accept.md @@ -0,0 +1,22 @@ +--- +'@clerk/clerk-expo': minor +--- + +Introduce `createClerkClient` to avoid importing the Clerk class from clerk-js manually. + +This enables developers to create and access a Clerk instance in their application outside of React. +```tsx + +import { ClerkProvider, createClerkClient } from "@clerk/expo" + +const clerkInstance = createClerkClient({ publishableKey: 'xxxx' }) + +// Be sure to pass the new instance to ClerkProvider to avoid running multiple instances of Clerk in your application + + ... + + +// Somewhere in your code, outside of React you can do +const token = await Clerk.session?.getToken(); +fetch('http://example.com/', {headers: {Authorization: token }) +```