@auth0/nextjs-auth0 - v4.33.0
    Preparing search index...

    Interface PasskeyClient

    Server-side passkey interface — individual step methods for authentication flows. Used by auth0.passkey on the server singleton. Each method maps directly to one Auth0 API call.

    interface PasskeyClient {
        challenge(
            options?: PasskeyChallengeOptions,
        ): Promise<PasskeyChallengeResponse>;
        enrollmentChallenge(
            options?: PasskeyEnrollmentChallengeOptions,
        ): Promise<PasskeyEnrollmentChallengeResponse>;
        enrollmentVerify(
            options: PasskeyEnrollmentVerifyOptions,
        ): Promise<PasskeyEnrollmentVerifyResponse>;
        getToken(options: PasskeyGetTokenOptions): Promise<void>;
        register(
            options?: PasskeyRegisterOptions,
        ): Promise<PasskeyRegisterResponse>;
    }
    Index
    • Complete a passkey signup or login by exchanging the WebAuthn assertion for an Auth0 session. Calls Auth0 POST /oauth/token with the WebAuthn grant. Session cookie is set automatically by the SDK.

      For a signup where register() returned verificationRequired, pass the codes the user entered in verification, for example { email: '123456' }. Omit it otherwise, including on login.

      On a wrong code this throws a PasskeyGetTokenError whose isRetryable is true, whose authSession is set and whose verificationRequired lists the identifiers still needing a code. Call again with the same authSession and credential, sending codes only for those identifiers.

      Parameters

      • options: PasskeyGetTokenOptions

        authSession from the challenge + serialised credential, and the verification codes when register() returned verificationRequired.

      Returns Promise<void>

      If there was an issue exchanging the credential for tokens. No session is persisted. When isRetryable is true, retry as described above. Otherwise the attempt is usually over, so start again with register() or challenge(). A temporary failure, such as rate limiting, can leave it open.

    • Request a WebAuthn credential creation challenge for a new user signup. Calls Auth0 POST /passkey/register.

      When the connection requires the user's email address or phone number to be verified, the response includes verificationRequired (for example ['email', 'phone']), and Auth0 sends a one-time code to each listed identifier during this call. verificationRequired is absent when no verification is required.

      deliveryMethod ('text' or 'voice') chooses how the phone code is delivered. Leave it out to let Auth0 use the channel the connection supports (SMS when it supports both or none). Auth0 rejects a channel that the connection does not support with invalid_request.

      Every call starts a separate attempt with its own authSession and, when verification is required, sends new codes. To recover from a wrong code, retry getToken() instead of calling this again. Do not rely only on Auth0's limits: rate-limit the route that calls this method yourself, per IP address and per email address or phone number.

      Parameters

      • Optionaloptions: PasskeyRegisterOptions

        User profile, optional connection/organization, and an optional deliveryMethod for the phone code.

      Returns Promise<PasskeyRegisterResponse>

      Challenge with authSession and authnParamsPublicKey.

      If there was an issue requesting the signup challenge, for example when a one-time code could not be sent.