class Stytch::WebAuthn

def authenticate_start(

The type of this field is +Integer+.
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 authentication.
public_key_credential_request_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, the `public_key_credential_creation_options` returned will be optimized for Passkeys with `userVerification` set to `"preferred"`.
return_passkey_credential_options::
The type of this field is nilable +String+.
The `user_id` of an active user the Passkey or WebAuthn registration should be tied to.
user_id::
The type of this field is +String+.
The domain for Passkeys or WebAuthn. Defaults to `window.location.hostname`.
domain::
== Parameters:

If you are not using the [webauthn-json](https://github.com/github/webauthn-json) library, `the public_key_credential_request_options` will need to be converted to a suitable public key by unmarshalling the JSON and converting some the fields to array buffers.

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. We recommend using the `get()` wrapper provided by the webauthn-json library.

To optimize for Passkeys, set the `return_passkey_credential_options` field to `true`.

Initiate the authentication of a Passkey or WebAuthn registration.
def authenticate_start(
  domain:,
  user_id: nil,
  return_passkey_credential_options: nil
)
  headers = {}
  request = {
    domain: domain
  }
  request[:user_id] = user_id unless user_id.nil?
  request[:return_passkey_credential_options] = return_passkey_credential_options unless return_passkey_credential_options.nil?
  post_request('/v1/webauthn/authenticate/start', request, headers)
end