# WebAuthn Signer (/smart-accounts/permissions/signers/passkeys)

> For the complete documentation index, see [llms.txt](/llms.txt)



Read [the passkeys doc](/onboarding/passkeys/overview) for a more detailed intro to passkeys.

## API [#api]

```typescript
import { toWebAuthnKey, toWebAuthnSigner, WebAuthnMode, WebAuthnSignerVersion} from "@zerodev/permissions/signers"

const passkeyName = "Key Name"  // any name you want
const passkeyServerUrl = "..."  // get this from ZeroDev dashboard
const mode = WebAuthnMode.Register  // can also be "login" if you are using an existing key

const webAuthnKey = await toWebAuthnKey({
  passkeyName,
  passkeyServerUrl,
  mode,
  passkeyServerHeaders: {}
})

const webAuthnSigner = await toWebAuthnSigner(publicClient, {
  webAuthnKey,
  webAuthnSignerVersion: WebAuthnSignerVersion.V0_0_2
})

const validator = toPermissionValidator(publicClient, {
  entryPoint,
  kernelVersion,
  signer: webAuthnSigner,
  policies: [
    // ...
  ],
})
```

For the params:

* `passkeyName` can be any name
* `passkeyServerUrl` is a [passkey server URL](/onboarding/passkeys/overview#setting-up-passkey-server).  You can get it from the ZeroDev dashboard.
* `mode` is either `register` or `login`, depending on whether you are creating a new key or using an existing key.
