provider Webauthn POST /v1/webauthn/authenticate/start
@utdk/stytch /v1/webauthn/authenticate/start
Authenticatestart
Initiate the authentication of a Passkey or WebAuthn registration. To optimize for Passkeys, set the `return_passkey_credential_options` field to `true`. After calling this endpoint, the browser will need to call [navigator.credentials.get()](https://www.w3.org/TR/webauthn-2/#sctn-getAssertion) with the data from `public_key_credential_request_options` passed to the [navigator.credentials.get()](https://www.w3.org/TR/webauthn-2/#sctn-getAssertion) request via the public key argument. When using built-in browser methods like `navigator.credentials.get()`, set the `use_base64_url_encoding` option to `true`. See our [WebAuthn setup guide](https://stytch.com/docs/guides/webauthn/api) for additional usage instructions and example code.

Try it

Authentication
Configure credentials for Stytch API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

apiWebauthnV1Authenticatestart
POST/v1/webauthn/authenticate/start
Initiate the authentication of a Passkey or WebAuthn registration. To optimize for Passkeys, set the `return_passkey_credential_options` field to `true`. After calling this endpoint, the browser will need to call [navigator.credentials.get()](https://www.w3.org/TR/webauthn-2/#sctn-getAssertion) with the data from `public_key_credential_request_options` passed to the [navigator.credentials.get()](https://www.w3.org/TR/webauthn-2/#sctn-getAssertion) request via the public key argument. When using built-in browser methods like `navigator.credentials.get()`, set the `use_base64_url_encoding` option to `true`. See our [WebAuthn setup guide](https://stytch.com/docs/guides/webauthn/api) for additional usage instructions and example code.

Input

required

The domain for Passkeys or WebAuthn. Defaults to `window.location.hostname`.

The `user_id` of an active user the Passkey or WebAuthn registration should be tied to. You may use an `external_id` here if one is set for the user.

If true, the `public_key_credential_creation_options` returned will be optimized for Passkeys with `userVerification` set to `"preferred"`.

If true, values in the `public_key_credential_creation_options` will be base64 URL encoded. Set this option to true when using built-in browser methods like `navigator.credentials.create` and `navigator.credentials.get`.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import stytch from '@utdk/stytch';

await stytch.apiWebauthnV1Authenticatestart()