Skip to content

Delete a passkey

Your users might want to delete their passkeys. You can do this using the @passlock/client and @passlock/server libraries. For deletion, we flip the order of operations, although strictly this is not required. Delete the passkey in your vault, then delete it from the user’s password manager.

Use the @passlock/server library to delete the passkey from your vault.

import { deletePasskey } from "@passlock/server";
const result = await deletePasskey({ passkeyId, tenancyId, apiKey });
// remove the mapping between the passkey and your local user account
await unlinkPasskey(passkeyId);
console.log("passkey deleted");

Use the @passlock/client library to delete the passkey from the user’s device.

import { deletePasskey } from "@passlock/client";
await deletePasskey({ tenancyId, passkeyId });
console.log("passkey deleted");