class Stytch::WebAuthn
def register_start(
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
status_code::
The type of this field is +String+.
Options used for Passkey or WebAuthn registration.
public_key_credential_creation_options::
The type of this field is +String+.
The unique ID of the affected User.
user_id::
The type of this field is +String+.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
request_id::
An object with the following fields:
== Returns:
The type of this field is nilable +Boolean+.
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`.
use_base64_url_encoding::
The type of this field is nilable +String+.
(no documentation yet)
override_display_name::
The type of this field is nilable +String+.
(no documentation yet)
override_name::
The type of this field is nilable +String+.
(no documentation yet)
override_id::
The type of this field is nilable +Boolean+.
If true, the `public_key_credential_creation_options` returned will be optimized for Passkeys with `residentKey` set to `"required"` and `userVerification` set to `"preferred"`.
return_passkey_credential_options::
The type of this field is nilable +String+.
The requested authenticator type of the Passkey or WebAuthn device. The two valid values are platform and cross-platform. If no value passed, we assume both values are allowed.
authenticator_type::
The type of this field is nilable +String+.
The user agent of the client.
user_agent::
The type of this field is +String+.
The domain for Passkeys or WebAuthn. Defaults to `window.location.hostname`.
domain::
The type of this field is +String+.
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.
user_id::
== Parameters:
See our [WebAuthn setup guide](https://stytch.com/docs/guides/webauthn/api) for additional usage instructions and example code.
When using built-in browser methods like `navigator.credentials.create()`, set the `use_base64_url_encoding` option to `true`.
After calling this endpoint, the browser will need to call [navigator.credentials.create()](https://www.w3.org/TR/webauthn-2/#sctn-createCredential) with the data from [public_key_credential_creation_options](https://w3c.github.io/webauthn/#dictionary-makecredentialoptions) passed to the [navigator.credentials.create()](https://www.w3.org/TR/webauthn-2/#sctn-createCredential) request via the public key argument.
To optimize for Passkeys, set the `return_passkey_credential_options` field to `true`.
Initiate the process of creating a new Passkey or WebAuthn registration.
def register_start( user_id:, domain:, user_agent: nil, authenticator_type: nil, return_passkey_credential_options: nil, override_id: nil, override_name: nil, override_display_name: nil, use_base64_url_encoding: nil ) headers = {} request = { user_id: user_id, domain: domain } request[:user_agent] = user_agent unless user_agent.nil? request[:authenticator_type] = authenticator_type unless authenticator_type.nil? request[:return_passkey_credential_options] = return_passkey_credential_options unless return_passkey_credential_options.nil? request[:override_id] = override_id unless override_id.nil? request[:override_name] = override_name unless override_name.nil? request[:override_display_name] = override_display_name unless override_display_name.nil? request[:use_base64_url_encoding] = use_base64_url_encoding unless use_base64_url_encoding.nil? post_request('/v1/webauthn/register/start', request, headers) end