Back to Clerk

README

packages/expo-passkeys/README.md

latest3.4 KB
Original Source
<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">
</picture>
</a> <h1 align="center">@clerk/expo-passkeys</h1> </p> <div align="center">

Changelog ยท Report a Bug ยท Request a Feature ยท Get help

</div>

Prerequisites

Usage

tsx
import { ClerkProvider } from '@clerk/expo';
import { passkeys } from '@clerk/expo/passkeys';

<ClerkProvider __experimental_passkeys={passkeys}></ClerkProvider>;

๐Ÿ”‘ Creating a Passkey

tsx
const { user } = useUser();

const handleCreatePasskey = async () => {
  if (!user) return;
  try {
    return await user.createPasskey();
  } catch (e: any) {
    // handle error
  }
};

๐Ÿ”“ Authenticating with a Passkey

tsx
const { signIn, setActive } = useSignIn();

const handlePasskeySignIn = async () => {
  try {
    const signInResponse = await signIn.authenticateWithPasskey();
    await setActive({ session: signInResponse.createdSessionId });
  } catch (err: any) {
    // handle error
  }
};

Support

You can get in touch with us in any of the following ways:

Contributing

We're open to all community contributions! If you'd like to contribute in any way, please read our contribution guidelines and code of conduct.

Security

@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.

License

This project is licensed under the MIT license.

See LICENSE for more information.