> ## Documentation Index
> Fetch the complete documentation index at: https://auth0.generaltranslation.app/llms.txt
> Use this file to discover all available pages before exploring further.

# MfaWebAuthnPlatformEnrollment

MfaWebAuthnPlatformEnrollment

```ts Example theme={null}
// Assuming 'sdk' is an instance of MfaWebAuthnPlatformEnrollment
try {
  await sdk.submitPasskeyCredential(); // No need to pass publicKey explicitly
  // On success, Auth0 handles redirection.
} catch (error) {
  console.error('Passkey enrollment failed:', error);
  if (error.name && error.message) { // Check if it looks like a WebAuthn error
    await sdk.reportBrowserError({ error: { name: error.name, message: error.message } });
  }
}
```

## Constructors

<ParamField body="MfaWebAuthnPlatformEnrollment" type="Constructor">
  Initializes a new instance of the `MfaWebAuthnPlatformEnrollment` class.

  #### Throws

  If the Universal Login Context is not available or if the screen name
  in the context does not match `MfaWebAuthnPlatformEnrollment.screenIdentifier`.
</ParamField>

## Properties

<ParamField body="branding" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/BrandingMembers">BrandingMembers</a></span>} />

<ParamField body="client" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/ClientMembers">ClientMembers</a></span>} />

<ParamField body="organization" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/OrganizationMembers">OrganizationMembers</a></span>} />

<ParamField body="prompt" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/PromptMembers">PromptMembers</a></span>} />

<ParamField body="screen" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/ScreenMembersOnMfaWebAuthnPlatformEnrollment">ScreenMembersOnMfaWebAuthnPlatformEnrollment</a></span>} />

<ParamField body="tenant" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/TenantMembers">TenantMembers</a></span>} />

<ParamField body="transaction" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/TransactionMembers">TransactionMembers</a></span>} />

<ParamField body="untrustedData" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/UntrustedDataMembers">UntrustedDataMembers</a></span>} />

<ParamField body="user" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/UserMembers">UserMembers</a></span>} />

<ParamField body="screenIdentifier" type="string">
  static
</ParamField>

## Methods

<ParamField body="getErrors" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/Error">Error</a>[]</span>}>
  Retrieves the array of transaction errors from the context, or an empty array if none exist.

  An array of error objects from the transaction context.
</ParamField>

<ParamField body="refuseEnrollmentOnThisDevice" type="Promise<void>">
  Allows the user to refuse WebAuthn platform enrollment on the current device.

  A promise that resolves upon successful submission of the refusal action.

  <Expandable title="Parameters">
    <ParamField body="payload?" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/CustomOptions">CustomOptions</a></span>}>
      Optional custom parameters to be sent with the request.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="reportBrowserError" type="Promise<void>">
  Reports a browser-side error encountered during the WebAuthn `navigator.credentials.create()` operation.

  A promise that resolves upon successful submission of the error report.

  #### Throws

  Throws an error if the form submission fails.

  <Expandable title="Parameters">
    <ParamField body="payload" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/ReportBrowserErrorOptions">ReportBrowserErrorOptions</a></span>}>
      **Properties**

      <ParamField body="error" type="object" />
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="snoozeEnrollment" type="Promise<void>">
  Allows the user to choose to snooze the WebAuthn platform enrollment.

  A promise that resolves upon successful submission of the snooze action.

  <Expandable title="Parameters">
    <ParamField body="payload?" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/CustomOptions">CustomOptions</a></span>}>
      Optional custom parameters to be sent with the request.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="submitPasskeyCredential" type="Promise<void>">
  Initiates the WebAuthn platform credential creation process using the public key options
  available on `this.screen.publicKey` and submits the resulting credential to the server.
  This method internally calls `createPasskeyCredentials` (which wraps `navigator.credentials.create()`).

  A promise that resolves when the credential is successfully created and submitted.

  #### Throws

  Throws an error if `this.screen.publicKey` is not available, if `createPasskeyCredentials` fails
  (e.g., user cancellation, hardware issues), or if the submission to the server fails.

  ```typescript Example theme={null}
  // Assuming 'sdk' is an instance of MfaWebAuthnPlatformEnrollment
  try {
    await sdk.submitPasskeyCredential(); // No need to pass publicKey explicitly
    // On success, Auth0 handles redirection.
  } catch (error) {
    console.error('Passkey enrollment failed:', error);
    if (error.name && error.message) { // Check if it looks like a WebAuthn error
      await sdk.reportBrowserError({ error: { name: error.name, message: error.message } });
    }
  }
  ```

  <Expandable title="Parameters">
    <ParamField body="payload?" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/SubmitPasskeyCredentialOptions">SubmitPasskeyCredentialOptions</a></span>}>
      Optional custom parameters to be sent to the server
      along with the created credential.
    </ParamField>
  </Expandable>
</ParamField>
