Overview
CredentialManager handles the local lifecycle of WebAuthn credentials - creating, saving, deploying, syncing, and deleting them. Access it via kit.credentials.
Credentials start as pending (registered but not yet deployed on-chain). After deployment, they become active and are associated with a smart account contract.
Methods
getAll()
Return all stored credentials (both pending and active).
getForWallet()
Return credentials associated with the currently connected wallet.
getPending()
Return credentials that are pending deployment.
create()
Register a new WebAuthn passkey and store the credential locally as pending.
save()
Save a pre-built credential object to local storage.
deploy()
Deploy a pending credential - moves it through the wallet connection flow and deploys the smart account contract.
sync()
Reconcile a single credential against on-chain state.
syncAll()
Reconcile all stored credentials against on-chain state. Useful on page load to clean up stale pending state.
delete()
Remove a pending credential from local storage. Only use this for credentials that never deployed.
delete() only removes the local record. If the credential was used on-chain, it remains on the contract. Use kit.signers.remove() to remove an on-chain signer.
Types