@clerk/expo-passkeys
Version:
Passkeys library to be used with Clerk for expo
101 lines (73 loc) • 3.54 kB
Markdown
<p align="center">
<a href="https://clerk.com?utm_source=github&utm_medium=clerk_expo_passkeys" target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://images.clerk.com/static/logo-dark-mode-400x400.png">
<img src="https://images.clerk.com/static/logo-light-mode-400x400.png" height="64">
</picture>
</a>
<br />
<h1 align="center">@clerk/expo-passkeys</h1>
</p>
<div align="center">
[](https://clerk.com/discord)
[](https://clerk.com/docs?utm_source=github&utm_medium=expo_passkeys)
[](https://twitter.com/intent/follow?screen_name=ClerkDev)
[](https://github.com/clerk/javascript/blob/main/packages/expo-passkeys/CHANGELOG.md)
·
[](https://github.com/clerk/javascript/issues/new?assignees=&labels=needs-triage&projects=&template=BUG_REPORT.yml)
·
[](https://feedback.clerk.com/roadmap)
·
[](https://clerk.com/contact/support?utm_source=github&utm_medium=expo_passkeys)
</div>
- Expo 51 or later
- React 18.0.2 or later
- React Native 0.73 or later
- Node.js `>=18.17.0` or later
- An existing Expo application.
- An existing Clerk application. [Create your account for free](https://dashboard.clerk.com/sign-up?utm_source=github&utm_medium=expo_passkeys).
- [Passkeys to be enabled ](https://clerk.com/docs/custom-flows/passkeys#enable-passkeys)
```tsx
import { ClerkProvider } from '@clerk/clerk-expo';
import { passkeys } from '@clerk/clerk-expo/passkeys';
<ClerkProvider __experimental_passkeys={passkeys}>{/* Your app here */}</ClerkProvider>;
```
```tsx
const { user } = useUser();
const handleCreatePasskey = async () => {
if (!user) return;
try {
return await user.createPasskey();
} catch (e: any) {
// handle error
}
};
```
```tsx
const { signIn, setActive } = useSignIn();
const handlePasskeySignIn = async () => {
try {
const signInResponse = await signIn.authenticateWithPasskey();
await setActive({ session: signInResponse.createdSessionId });
} catch (err: any) {
// handle error
}
};
```
You can get in touch with us in any of the following ways:
- Join our official community [Discord server](https://clerk.com/discord)
- On [our support page](https://clerk.com/contact/support?utm_source=github&utm_medium=expo_passkeys)
We're open to all community contributions! If you'd like to contribute in any way, please read [our contribution guidelines](https://github.com/clerk/javascript/blob/main/docs/CONTRIBUTING.md) and [code of conduct](https://github.com/clerk/javascript/blob/main/docs/CODE_OF_CONDUCT.md).
`@clerk/expo-passkeys` follows good practices of security, but 100% security cannot be assured.
`@clerk/expo-passkeys` is provided **"as is"** without any **warranty**. Use at your own risk.
_For more information and to report security issues, please refer to our [security documentation](https://github.com/clerk/javascript/blob/main/docs/SECURITY.md)._
This project is licensed under the **MIT license**.
See [LICENSE](https://github.com/clerk/javascript/blob/main/packages/expo-passkeys/LICENSE) for more information.