Skip to content

Commit

Permalink
feat(expo): Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed May 24, 2024
1 parent b0dd296 commit cd6885f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .changeset/calm-wasps-accept.md
Original file line number Diff line number Diff line change
@@ -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
<ClerkProvider Clerk={clerkInstance}>
...
</ClerkProvider>

// Somewhere in your code, outside of React you can do
const token = await Clerk.session?.getToken();
fetch('http://example.com/', {headers: {Authorization: token })
```

0 comments on commit cd6885f

Please sign in to comment.