# Passkeys for Websites: How to Add Passkey Login Without Losing Customers

By [Eoin Villarin](https://amvprosox.com/about). Published 2026-10-18, updated 2026-10-28. Canonical: https://amvprosox.com/blog/passkeys-website-login-guide

> Passkeys cut sign-in time and failed logins, but a careless rollout can lock customers out. Learn how to add passkey login with WebAuthn, autofill and safe fallbacks.

## How do I add passkey login to my website without losing customers?

Add passkey login beside existing sign-in methods instead of switching passwords off overnight. Use the WebAuthn API with a maintained library such as SimpleWebAuthn, turn on passkey autofill, offer a passkey right after a successful sign-in or on the order confirmation page, keep a password or email code fallback, and design account recovery before launch.

**Key takeaways**

- The FIDO Passkey Index reported 93% sign-in success with passkeys, compared with 63% for other methods.
- Average passkey sign-in took 8.5 seconds versus 31.2 seconds for email codes, SMS codes and social login.
- 47% of consumers said they are likely to abandon a purchase or sign-in when they cannot remember their password.
- Set the relying party ID to the registrable domain from day one, because changing it later invalidates every passkey.
- Passkey autofill uses conditional mediation: add webauthn to the username autocomplete value and start a pending WebAuthn request on load.

Every failed login costs you something: an abandoned cart, a support ticket or a customer who quietly buys from a competitor that remembers them. **Passkey login** fixes the most fragile step in that journey by replacing the password with a cryptographic key that lives on the customer's phone, laptop or password manager and unlocks with a fingerprint, face scan or screen lock PIN.

The catch is that a badly planned rollout can lock people out just as easily as a forgotten password. Customers switch devices, share family computers and shop in browsers you never tested. The goal is not to switch passwords off overnight, it is to make passkeys the easiest option while everything else keeps working.

In this guide I cover how passkeys work, the WebAuthn code for registration and autofill sign-in, a rollout plan that protects conversion, and what is realistic on Shopify, WordPress and custom builds as of late 2026.

## Why is passkey login worth adding in 2026?

Passkeys are no longer an early-adopter feature. The FIDO Alliance's [State of Passkeys 2026 report](https://fidoalliance.org/fido-alliance-reports-accelerating-global-passkey-adoption-on-world-passkey-day-2026/), published on 7 May 2026 and based on 11,000 consumers across ten countries, found that 90% of people are aware of passkeys, 75% have enabled one on at least one account and 49% use them regularly when they are offered. The Alliance estimates around 5 billion passkeys are now in use.

![Hand placed on a biometric scanner, the same kind of check passkeys use](https://amvprosox.com/api/img/1793146573148-rgmlyh)
*Passkeys turn sign-in into one biometric or PIN prompt. Photo: rawpixel, CC0*

The same research points straight at the commercial problem. **47% of consumers** said they are likely to abandon a purchase or sign-in when they cannot remember their password. For an online store, that is a checkout leak you can measure.

Data from companies that already run passkeys at scale is just as clear. The [FIDO Passkey Index](https://fidoalliance.org/fido-alliance-launches-passkey-index-revealing-significant-passkey-uptake-and-business-benefits/), released in October 2025 with data from Amazon, Google, Microsoft, PayPal, Target, TikTok and others, reported:

- **93% sign-in success** with passkeys, compared with 63% for other methods.

- **8.5 seconds** average sign-in time, against 31.2 seconds for email codes, SMS codes and social login, a 73% reduction.

- **81% fewer** login-related help desk incidents.

These are huge platforms, so treat the figures as a direction rather than a promise for your site.

## How do passkeys actually work?

A passkey is a public and private key pair created for one website. The private key stays on the customer's device or inside their password manager. Your server only ever stores the public key, which is useless to an attacker on its own.

When someone signs in, your server sends a random challenge. The device asks the user to confirm with biometrics or a PIN, signs the challenge with the private key and returns the signature, which your server checks against the stored public key. No shared secret ever crosses the network.

Each passkey is also bound to your domain, known as the **relying party ID**. A lookalike phishing site on another domain simply cannot request it. That is why passkeys are described as phishing-resistant rather than just stronger passwords.

### Synced passkeys vs device-bound passkeys

Most consumer passkeys are **synced**. Apple Passwords, Google Password Manager and third-party managers such as 1Password or Bitwarden back them up and make them available across the user's devices. Device-bound passkeys live on a single piece of hardware, such as a security key, and are more common in workplaces.

Synced passkeys are what make a consumer rollout realistic, because losing a phone no longer means losing the account. NIST's final [SP 800-63B-4 guidelines](https://csrc.nist.gov/pubs/sp/800/63/b/4/final), published in July 2025, formally integrate syncable authenticators such as synced passkeys. Portability is improving too: Apple added passkey export and import between password managers in iOS 26 and macOS 26, based on the FIDO Credential Exchange Protocol.

### What your server stores

For each passkey you keep the credential ID, the public key, a signature counter, the reported transports and the user it belongs to. One user should be able to hold several passkeys, for example one in iCloud Keychain and another in Google Password Manager.

## How to add passkey login to an existing website

You do not need to rebuild authentication from scratch. Passkeys sit beside your existing accounts table and the browser does the heavy lifting through the WebAuthn API. This is the flow I use on custom Node.js builds, with the open source SimpleWebAuthn library on the server and native browser APIs on the client.

### Step 1: Create a passkeys table

Add a table keyed by credential ID with a foreign key to your users table. Validate every request body before it touches the database, using the approach in my guide to [type-safe API validation with Zod](https://amvprosox.com/blog/typescript-zod-type-safe-api-validation).

### Step 2: Generate registration options and verify the response

When a signed-in user chooses to create a passkey, the server generates options with a fresh challenge, then verifies what the browser sends back:

```
import {
  generateRegistrationOptions,
  verifyRegistrationResponse,
} from '@simplewebauthn/server';

const rpID = 'example.com';
const origin = 'https://example.com';

// POST /api/passkeys/register/options (user must be signed in)
export async function registrationOptions(user) {
  const options = await generateRegistrationOptions({
    rpName: 'Example Store',
    rpID,
    userName: user.email,
    excludeCredentials: user.passkeys.map((p) => ({ id: p.id, transports: p.transports })),
    authenticatorSelection: { residentKey: 'required', userVerification: 'preferred' },
  });
  await saveChallenge(user.id, options.challenge);
  return options;
}

// POST /api/passkeys/register/verify
export async function verifyRegistration(user, body) {
  const { verified, registrationInfo } = await verifyRegistrationResponse({
    response: body,
    expectedChallenge: await getChallenge(user.id),
    expectedOrigin: origin,
    expectedRPID: rpID,
  });

  if (verified) {
    const { credential } = registrationInfo;
    await db.passkeys.insert({ ...credential, userId: user.id });
  }
  return verified;
}
```

Setting `residentKey: 'required'` creates a discoverable credential, which is what allows the passkey to appear in autofill before the user types anything. The `excludeCredentials` list stops the same password manager from creating a duplicate for that account.

### Step 3: Create the passkey in the browser

Browsers can now parse the server's JSON directly. `PublicKeyCredential.parseCreationOptionsFromJSON()` and `toJSON()` have worked across Chrome, Edge, Firefox and Safari since early 2025, so hand-written base64url helpers are no longer needed:

```
const optionsJSON = await fetch('/api/passkeys/register/options', { method: 'POST' })
  .then((res) => res.json());

const credential = await navigator.credentials.create({
  publicKey: PublicKeyCredential.parseCreationOptionsFromJSON(optionsJSON),
});

await fetch('/api/passkeys/register/verify', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(credential.toJSON()),
});
```

### Step 4: Sign in with passkey autofill

The smoothest sign-in uses **conditional mediation**, usually called passkey autofill. You add `webauthn` to the username field's autocomplete value and start a pending WebAuthn request when the page loads. Saved passkeys then appear in the same dropdown as saved passwords, as explained in web.dev's guide to [signing in with a passkey through form autofill](https://web.dev/articles/passkey-form-autofill).

```
Email

  if (window.PublicKeyCredential &&
      await PublicKeyCredential.isConditionalMediationAvailable?.()) {
    const optionsJSON = await fetch('/api/passkeys/login/options', { method: 'POST' })
      .then((res) => res.json());

    // Waits quietly until the user picks a passkey from the autofill list
    const credential = await navigator.credentials.get({
      publicKey: PublicKeyCredential.parseRequestOptionsFromJSON(optionsJSON),
      mediation: 'conditional',
    });

    const res = await fetch('/api/passkeys/login/verify', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(credential.toJSON()),
    });
    if (res.ok) window.location.assign('/account');
  }

```

If the user picks a saved password instead, the pending request never resolves and your normal form submission carries on. Nothing breaks for people who are not ready for passkeys.

### Step 5: Verify the assertion and start the session

On the server, generate authentication options with only your `rpID` and leave `allowCredentials` empty so discoverable passkeys work. Look up the stored passkey by the credential ID in the response and pass it to `verifyAuthenticationResponse()` with the expected challenge, origin and RP ID. If it verifies, save the new counter and create the session exactly as you would after a password login.

## How to roll out passkeys without losing customers

The code is the easy part. The rollout is where conversion is won or lost.

![Bunch of keys on a table, a reminder to keep a fallback sign-in method](https://amvprosox.com/api/img/1793146574286-kklw2x)
*Make passkeys the easy path and keep a fallback. Photo: rawpixel, CC0*

### Offer a passkey at a moment of success

Do not push passkey creation on a new visitor before they have bought anything. Offer it right after a successful sign-in or on the order confirmation page, with one clear sentence such as "Sign in faster next time with your fingerprint, face or screen lock."

With **conditional create**, a user who has just signed in with a saved password can be given a passkey without an extra prompt. Chrome's documentation on [conditional create](https://developer.chrome.com/docs/identity/webauthn-conditional-create) recommends calling it immediately after a successful password login and silently ignoring the errors thrown when the conditions are not met:

```
// Run right after a successful password sign-in
const caps = await PublicKeyCredential.getClientCapabilities?.();

if (caps?.conditionalCreate) {
  try {
    const credential = await navigator.credentials.create({
      publicKey: PublicKeyCredential.parseCreationOptionsFromJSON(optionsJSON),
      mediation: 'conditional',
    });
    await savePasskey(credential.toJSON());
  } catch (err) {
    // InvalidStateError, NotAllowedError and AbortError are expected: ignore them
  }
}
```

### Keep a fallback until the numbers say otherwise

Keep passwords or email one-time codes available while passkey usage grows. Even among the large companies in the FIDO Passkey Index, 36% of accounts had a passkey enrolled and 26% of sign-ins used one after one to three years of rollout. Your customers will sit somewhere on that same curve.

### Design account recovery before launch

Recovery is the weakest link in any passwordless system. If a customer loses every device, they need a verified email route back in, protected as carefully as the passkey itself. Let users see, rename and delete their passkeys from an account settings page.

### Use plain language and measure the right things

Say "passkey" consistently, because that is the word Apple, Google and Microsoft use, and keep terms like WebAuthn and FIDO2 out of customer-facing copy. Then track the share of sign-ins that use passkeys, sign-in success rate by method and password reset requests each month.

## Passkeys vs passwords vs one-time codes: which sign-in should you offer?

Most websites will run a mix of methods for years. This comparison shows where each one fits.

| Method | Phishing resistance | Customer friction | Main risk | Best use |
| --- | --- | --- | --- | --- |
| Password only | Low | High: remembering and resetting | Reuse and credential stuffing | Legacy fallback |
| Password plus SMS code | Medium | High: two steps, delayed texts | SIM swaps and phishing relays | Transitional extra security |
| Email one-time code or magic link | Medium | Medium: switching to the inbox | Inbox compromise and delays | Guest checkout and recovery |
| Social sign-in | Depends on the provider | Low | Reliance on a third party | Fast account creation |
| Passkey | High: bound to your domain | Low: one biometric or PIN prompt | Recovery if every device is lost | Default for returning customers |

> Passkeys are one of the rare security upgrades that also remove friction. Treat them as a conversion feature with security benefits, not a security project that customers have to tolerate.

## Passkeys on Shopify, WordPress and custom apps

How much control you have depends on the platform you are on.

![Laptop and tablet side by side on a desk for testing sign-in across devices](https://amvprosox.com/api/img/1793146575542-2ismuc)
*Test passkeys across every major browser and device. Photo: rawpixel, CC0*

### Shopify

On Shopify you do not write WebAuthn code yourself. Customer accounts use passwordless email codes, and Shop, Shopify's wallet and app, supports passkeys for Shop Pay checkout and for signing in to customer accounts through Shop. The practical work for merchants is enabling Shop Pay and the current customer accounts, then keeping checkout customisations compatible, which I cover in my guide to [Shopify checkout extensibility](https://amvprosox.com/blog/shopify-checkout-extensibility-ui-extensions-guide). On larger Shopify Plus builds, such as the [Real Mad Honey store](https://amvprosox.com/case-studies/realmadhoney), the focus is the same: lean on Shop Pay rather than a custom login.

### WordPress and WooCommerce

WordPress core does not include built-in passkey sign-in, so in practice you rely on plugins. The Two Factor feature plugin can be extended with a WebAuthn provider, and several standalone plugins add a passkey button to the login screen. Pick plugins with recent updates, test them with the WooCommerce My Account and checkout login, and vet them like any other security plugin, as covered in my post on [WordPress plugin vulnerabilities in 2026](https://amvprosox.com/blog/wordpress-security-plugin-vulnerabilities-2026).

### Custom apps and headless builds

On Next.js, Node.js or Laravel builds you have full control. Use a maintained library such as SimpleWebAuthn instead of writing signature checks yourself, or choose a managed identity provider that already supports passkeys.

## Common passkey mistakes and how to avoid them

- **Choosing the wrong RP ID.** Passkeys created for `shop.example.com` will not work on `example.com`. Set the RP ID to the registrable domain from day one, because changing it later invalidates every passkey.

- **Mismatched origins.** WebAuthn only runs in secure contexts, with `localhost` allowed for development. The expected origin must match exactly, including the port.

- **One passkey per account.** People live in more than one ecosystem. Let them register several and label each one.

- **Stale passkeys in password managers.** Deleting a passkey on your site does not remove it from the user's password manager. Chrome and Edge support the WebAuthn Signal API, including `PublicKeyCredential.signalUnknownCredential()`, to tell the manager to hide it. Feature-detect it, because support in other browsers varies.

- **Testing only on your own phone.** Test Safari on iPhone, Chrome on Android, Edge on Windows and Firefox, plus QR code sign-in from a phone.

- **Ignoring accessibility.** WCAG 2.2 success criterion 3.3.8, Accessible Authentication, does not allow memory tests such as recalling a password unless help like paste or a password manager is available. Passkeys are one of the cleanest ways to meet it, which matters now that the [European Accessibility Act](https://amvprosox.com/blog/european-accessibility-act-website-compliance) is being enforced.

## Frequently asked questions

### Do passkeys replace passwords completely?

Not yet for most websites. Passkeys should become the default for returning customers, but you still need a fallback such as an email one-time code or a password for people on older devices, shared computers or unsupported browsers. Reduce password use gradually and watch how many sign-ins use passkeys before you consider removing passwords entirely.

### What happens if a customer loses their phone?

If the passkey was synced, it is still available on the customer's other devices through Apple Passwords, Google Password Manager or a third-party manager, and a replacement phone restores it after signing in to that account. If they lose access to everything, your recovery flow takes over, usually a verified email code followed by creating a new passkey.

### Are passkeys secure enough for ecommerce and payments?

Yes. Each passkey is bound to your domain, which makes it phishing-resistant, and your server stores only a public key, so a database breach does not leak reusable secrets. NIST's SP 800-63B-4 guidelines integrate synced passkeys, and payment and retail companies including PayPal, Amazon and Target contributed data to the FIDO Passkey Index.

### How long does it take to add passkey login to a website?

In my experience, a custom site with a clean authentication layer needs one to two weeks of development and testing for registration, autofill sign-in and a passkey management page. Plugin-based WordPress setups can be quicker. Sites with several subdomains, native mobile apps or single sign-on need more planning around the RP ID and account recovery.

## Next steps: plan your passkey rollout

Passkey login is one of the few upgrades that improves security and conversion at the same time. Offer passkeys to signed-in users, switch on autofill sign-in, measure the results and keep a solid fallback until your own data says otherwise.

If you want help adding passkeys to a custom app, hardening a WordPress login or tidying up a Shopify customer account flow, [send me a message through the contact form](https://amvprosox.com/#contact-form) or browse [my case studies](https://amvprosox.com/case-studies) to see the kinds of builds I work on.
