-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0dd296
commit cd6885f
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }) | ||
``` |