Passkeys
Passwordless sign-in with Face ID, Touch ID, Windows Hello, and security keys.
Passkeys
Passkeys replace passwords with a key pair stored on the user's device or in their password manager. Sign-in is a fingerprint, face scan, or device PIN, and there is nothing to phish or leak: Ploy stores only the public key.
Enable passkeys
Open Auth → Settings in the dashboard, turn on Passkeys, and save. No provider setup is needed.
Passkeys can be the only sign-in method or sit alongside passwords and social sign-in.
What users can do
| Flow | How |
|---|---|
| Sign up | Enter an email and create a passkey instead of a password. Requires Allow sign-ups. |
| Sign in | Choose Sign in with a passkey; the browser offers the passkeys saved for your domain. No email needed. |
| Add a passkey | A signed-in user (any method) registers a passkey for their account. |
| Remove a passkey | A signed-in user deletes one of their passkeys. The last remaining sign-in method cannot be removed. |
Passkey sign-up refuses an email that already has an account; the user signs in first and then adds a passkey. This stops anyone from attaching their passkey to someone else's account.
With React
SignInForm shows a passkey button and SignUpForm offers passkey sign-up when passkeys are on. For a custom UI or an account settings page, use useAuth:
"use client";
import { useAuth } from "@meetploy/auth-react";
export function PasskeySettings() {
const { signInWithPasskey, addPasskey, listPasskeys, removePasskey } =
useAuth();
return (
<>
<button onClick={() => signInWithPasskey()}>
Sign in with a passkey
</button>
<button onClick={() => addPasskey("My laptop")}>Add a passkey</button>
</>
);
}| Method | Description |
|---|---|
signInWithPasskey() | Prompt for a saved passkey and sign in |
signUpWithPasskey(email, metadata?) | Create an account secured by a new passkey |
addPasskey(name?) | Register another passkey for the signed-in user |
listPasskeys() | The signed-in user's passkeys |
removePasskey(id) | Delete one of the signed-in user's passkeys |
Domains
A passkey belongs to the domain it was created on. A passkey made on app.example.com works only there, not on your default deployment URL or a preview URL. Point users at one canonical domain for sign-in.
With shared sessions on, passkeys belong to the shared domain instead: a passkey created on app.example.com with example.com shared also works on api.example.com. Passkeys created before you change the setting keep their old domain. Before the change, have users add an alternative sign-in method; afterward, use it to sign in, add and test a new passkey, and only then remove the old one. Do not rely on an existing shared session: changing or disabling its domain rejects that session. See the migration checklist to avoid locking out passkey-only users.
Passkey requests must come from your app's own pages: Ploy checks the
browser's Origin against the domain serving /_ploy/auth, or sibling
origins on the same scheme and port when shared sessions are enabled.
Lifecycle hooks
For new accounts, beforeSignUp runs before registration options are issued; afterSignUp and afterSignIn follow successful verification. A passkey login calls beforeSignIn only after the credential verifies. Adding a key to an already signed-in account does not create a session or emit sign-up/sign-in hooks.
Local development
Browsers allow passkeys on localhost without HTTPS, so ploy dev supports passkeys out of the box. Passkeys created locally only work locally.
How is this guide?
Last updated on