Skip to content

Programmatically updating a passkey on a user's local device

Passkey before a device local name change

Becomes…

Passkey after a device local name change

Use the updatePasskey function in your frontend code to perform local (device) updates:

import { updatePasskey, isUpdateError } from "@passlock/client";
try {
// this will update the names in the user's password manager
await updatePasskey({
tenancyId,
passkeyId,
username: "newUsername@example.com",
displayName: "My new username"
});
alert("Passkey updated");
} catch (e) {
if (isUpdateError(e)) {
alert("Unable to update your passkey");
}
}