Ploy
Ploy
Authentication

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

FlowHow
Sign upEnter an email and create a passkey instead of a password. Requires Allow sign-ups.
Sign inChoose Sign in with a passkey; the browser offers the passkeys saved for your domain. No email needed.
Add a passkeyA signed-in user (any method) registers a passkey for their account.
Remove a passkeyA 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>
		</>
	);
}
MethodDescription
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.

Passkey requests must come from your app's own pages: Ploy checks the browser's Origin against the domain serving /_ploy/auth.

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