Skip to main content
  • Registration (“sign up”) creates a new key pair: this is your passkey
  • Authentication (“sign in”) uses an existing passkey to sign a message, proving ownership of the associated private key stored on your device.

Passkeys on the web

Creating and using passkeys on the web is straightforward: browsers offer APIs to do it!
  • navigator.credentials.create creates a passkey
  • navigator.credentials.get prompts the user to select a passkey to sign a message
Creating and checking a passkey in the browser doesn’t require a backend. An important security feature of passkeys: they’re domain-bound to prevent phishing. In other words: passkeys created on app.example.com won’t be usable on evil.example.com, for example. Browsers prevent this.

Native platform APIs

Android

In the Android ecosystem the CredentialManager supports creating and using passkeys with CreatePublicKeyCredentialRequest and GetCredentialRequest. See the associated documentation for more information.

iOS

iOS APIs to create and use passkeys are available as well:
  • ASAuthorizationPlatformPublicKeyCredentialProvider(…).createCredentialRegistrationRequest for passkey creation
  • ASAuthorizationPlatformPublicKeyCredentialProvider(…).createCredentialAssertionRequest for passkey usage
See these docs for more info.

Native 0xkey SDKs

For fully native apps, use the Swift SDK (iOS / macOS) or the Kotlin SDK (Android). Both wrap the platform passkey APIs above, stamp 0xkey requests with passkeys or session keys, and cover sign-in, wallets and signing.

Building with React Native

0xkey has a fully-featured TypeScript SDK. It provides a type-safe client to call the 0xkey API and abstracts activity request signing. React Native lets you write your app in Typescript and compile it into native code for both iOS and Android automatically. To sign 0xkey requests with native passkeys in a React Native application we’ve released @0xkey-io/react-native-passkey-stamper, a package compatible with our TypeScript client to sign 0xkey requests with native passkeys. Under the hood this package wraps react-native-passkey, which calls the right native APIs on iOS and Android, and exports a unified interface that we leverage. Bottom-line: if you’ve used our webauthn stamper or API key stamper, using our React Native passkey stamper will feel familiar. Take a look at the “Installation” and “Usage” sections to get started with passkeys in your React Native application.

Linking apps and web domains

Passkeys on native apps aren’t app-bound, they’re domain bound just like web passkeys. This may come as a surprise: you’ll have to configure a web domain to use passkeys natively! Configuration is done separately per ecosystem, but the idea is the same: This unlocks interesting flows where users use their web-created passkeys in a “companion” native app, or vice-versa. For example: a native app linked to your app.example.com domain would allow users to log into their account from a native mobile app using their web-created passkey as long as they’re synced properly. Note that these associations are “many-to-many”: a website can link multiple associated apps, and a single native application can choose to create passkeys for multiple domains, via a dropdown for example. However (as far as we know) a single passkey is always bound to a single web domain: it can’t be bound to multiple web domains.