These are the SDK reference docs. If you’re looking for docs to implement SuperTokens, you might want to check out the User Guides

Module recipe/webauthn

Index

Type Aliases

APIInterface: { emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: UserContext }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); generateRecoverAccountTokenPOST: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: UserContext }) => Promise<{ status: "OK" } | GeneralErrorResponse | GenerateRecoverAccountTokenPOSTErrorResponse>); recoverAccountPOST: undefined | ((input: { credential: RegistrationPayload; options: APIOptions; tenantId: string; token: string; userContext: UserContext; webauthnGeneratedOptionsId: string }) => Promise<{ email: string; status: "OK"; user: User } | GeneralErrorResponse | RecoverAccountPOSTErrorResponse>); registerCredentialPOST: undefined | ((input: { credential: RegistrationPayload; options: APIOptions; session: SessionContainer; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }) => Promise<{ status: "OK" } | GeneralErrorResponse | RegisterCredentialPOSTErrorResponse>); registerOptionsPOST: undefined | ((input: { options: APIOptions; tenantId: string; userContext: UserContext } & ({ displayName?: string; email: string } | { recoverAccountToken: string })) => Promise<{ attestation: "none" | "indirect" | "direct" | "enterprise"; authenticatorSelection: { requireResidentKey: boolean; residentKey: ResidentKey; userVerification: UserVerification }; challenge: string; createdAt: string; excludeCredentials: { id: string; transports: ("ble" | "hybrid" | "internal" | "nfc" | "usb")[]; type: "public-key" }[]; expiresAt: string; pubKeyCredParams: { alg: number; type: string }[]; rp: { id: string; name: string }; status: "OK"; timeout: number; user: { displayName: string; id: string; name: string }; webauthnGeneratedOptionsId: string } | GeneralErrorResponse | RegisterOptionsPOSTErrorResponse>); signInOptionsPOST: undefined | ((input: { options: APIOptions; tenantId: string; userContext: UserContext }) => Promise<{ challenge: string; createdAt: string; expiresAt: string; rpId: string; status: "OK"; timeout: number; userVerification: UserVerification; webauthnGeneratedOptionsId: string } | GeneralErrorResponse | SignInOptionsPOSTErrorResponse>); signInPOST: undefined | ((input: { credential: AuthenticationPayload; options: APIOptions; session: SessionContainer | undefined; shouldTryLinkingWithSessionUser: boolean | undefined; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | SignInPOSTErrorResponse>); signUpPOST: undefined | ((input: { credential: RegistrationPayload; options: APIOptions; session: SessionContainer | undefined; shouldTryLinkingWithSessionUser: boolean | undefined; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | SignUpPOSTErrorResponse>) }

Type declaration

  • emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: UserContext }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
  • generateRecoverAccountTokenPOST: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: UserContext }) => Promise<{ status: "OK" } | GeneralErrorResponse | GenerateRecoverAccountTokenPOSTErrorResponse>)
  • recoverAccountPOST: undefined | ((input: { credential: RegistrationPayload; options: APIOptions; tenantId: string; token: string; userContext: UserContext; webauthnGeneratedOptionsId: string }) => Promise<{ email: string; status: "OK"; user: User } | GeneralErrorResponse | RecoverAccountPOSTErrorResponse>)
  • registerCredentialPOST: undefined | ((input: { credential: RegistrationPayload; options: APIOptions; session: SessionContainer; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }) => Promise<{ status: "OK" } | GeneralErrorResponse | RegisterCredentialPOSTErrorResponse>)
  • registerOptionsPOST: undefined | ((input: { options: APIOptions; tenantId: string; userContext: UserContext } & ({ displayName?: string; email: string } | { recoverAccountToken: string })) => Promise<{ attestation: "none" | "indirect" | "direct" | "enterprise"; authenticatorSelection: { requireResidentKey: boolean; residentKey: ResidentKey; userVerification: UserVerification }; challenge: string; createdAt: string; excludeCredentials: { id: string; transports: ("ble" | "hybrid" | "internal" | "nfc" | "usb")[]; type: "public-key" }[]; expiresAt: string; pubKeyCredParams: { alg: number; type: string }[]; rp: { id: string; name: string }; status: "OK"; timeout: number; user: { displayName: string; id: string; name: string }; webauthnGeneratedOptionsId: string } | GeneralErrorResponse | RegisterOptionsPOSTErrorResponse>)
  • signInOptionsPOST: undefined | ((input: { options: APIOptions; tenantId: string; userContext: UserContext }) => Promise<{ challenge: string; createdAt: string; expiresAt: string; rpId: string; status: "OK"; timeout: number; userVerification: UserVerification; webauthnGeneratedOptionsId: string } | GeneralErrorResponse | SignInOptionsPOSTErrorResponse>)
  • signInPOST: undefined | ((input: { credential: AuthenticationPayload; options: APIOptions; session: SessionContainer | undefined; shouldTryLinkingWithSessionUser: boolean | undefined; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | SignInPOSTErrorResponse>)
  • signUpPOST: undefined | ((input: { credential: RegistrationPayload; options: APIOptions; session: SessionContainer | undefined; shouldTryLinkingWithSessionUser: boolean | undefined; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | SignUpPOSTErrorResponse>)
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeWebauthnEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

RecipeInterface: { consumeRecoverAccountToken: any; createNewRecipeUser: any; generateRecoverAccountToken: any; getCredential: any; getGeneratedOptions: any; getUserFromRecoverAccountToken: any; listCredentials: any; registerCredential: any; registerOptions: any; removeCredential: any; removeGeneratedOptions: any; signIn: any; signInOptions: any; signUp: any; updateUserEmail: any; verifyCredentials: any }

Type declaration

  • consumeRecoverAccountToken:function
    • consumeRecoverAccountToken(input: { tenantId: string; token: string; userContext: UserContext }): Promise<{ email: string; status: "OK"; userId: string } | ConsumeRecoverAccountTokenErrorResponse>
    • Parameters

      • input: { tenantId: string; token: string; userContext: UserContext }
        • tenantId: string
        • token: string
        • userContext: UserContext

      Returns Promise<{ email: string; status: "OK"; userId: string } | ConsumeRecoverAccountTokenErrorResponse>

  • createNewRecipeUser:function
    • createNewRecipeUser(input: { credential: RegistrationPayload; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }): Promise<CreateNewRecipeUserErrorResponse | { recipeUserId: RecipeUserId; status: "OK"; user: User }>
    • This function is meant only for creating the recipe in the core and nothing else. We added this even though signUp exists cause devs may override signup expecting it to be called just during sign up. But we also need a version of signing up which can be called during operations like creating a user during account recovery flow.

      Parameters

      • input: { credential: RegistrationPayload; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }
        • credential: RegistrationPayload
        • tenantId: string
        • userContext: UserContext
        • webauthnGeneratedOptionsId: string

      Returns Promise<CreateNewRecipeUserErrorResponse | { recipeUserId: RecipeUserId; status: "OK"; user: User }>

  • generateRecoverAccountToken:function
    • generateRecoverAccountToken(input: { email: string; tenantId: string; userContext: UserContext; userId: string }): Promise<{ status: "OK"; token: string } | GenerateRecoverAccountTokenErrorResponse>
    • We pass in the email as well to this function cause the input userId may not be associated with an webauthn account. In this case, we need to know which email to use to create an webauthn account later on.

      Parameters

      • input: { email: string; tenantId: string; userContext: UserContext; userId: string }
        • email: string
        • tenantId: string
        • userContext: UserContext
        • userId: string

      Returns Promise<{ status: "OK"; token: string } | GenerateRecoverAccountTokenErrorResponse>

  • getCredential:function
    • getCredential(input: { recipeUserId: string; userContext: UserContext; webauthnCredentialId: string }): Promise<{ createdAt: number; recipeUserId: RecipeUserId; relyingPartyId: string; status: "OK"; webauthnCredentialId: string } | GetCredentialErrorResponse>
    • Parameters

      • input: { recipeUserId: string; userContext: UserContext; webauthnCredentialId: string }
        • recipeUserId: string
        • userContext: UserContext
        • webauthnCredentialId: string

      Returns Promise<{ createdAt: number; recipeUserId: RecipeUserId; relyingPartyId: string; status: "OK"; webauthnCredentialId: string } | GetCredentialErrorResponse>

  • getGeneratedOptions:function
    • getGeneratedOptions(input: { tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }): Promise<{ challenge: string; createdAt: number; email: string; expiresAt: number; origin: string; relyingPartyId: string; relyingPartyName: string; status: "OK"; timeout: string; userPresence: boolean; userVerification: UserVerification; webauthnGeneratedOptionsId: string } | GetGeneratedOptionsErrorResponse>
    • Parameters

      • input: { tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }
        • tenantId: string
        • userContext: UserContext
        • webauthnGeneratedOptionsId: string

      Returns Promise<{ challenge: string; createdAt: number; email: string; expiresAt: number; origin: string; relyingPartyId: string; relyingPartyName: string; status: "OK"; timeout: string; userPresence: boolean; userVerification: UserVerification; webauthnGeneratedOptionsId: string } | GetGeneratedOptionsErrorResponse>

  • getUserFromRecoverAccountToken:function
    • getUserFromRecoverAccountToken(input: { tenantId: string; token: string; userContext: UserContext }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | GetUserFromRecoverAccountTokenErrorResponse>
    • Parameters

      • input: { tenantId: string; token: string; userContext: UserContext }
        • tenantId: string
        • token: string
        • userContext: UserContext

      Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | GetUserFromRecoverAccountTokenErrorResponse>

  • listCredentials:function
    • listCredentials(input: { recipeUserId: string; userContext: UserContext }): Promise<{ credentials: { createdAt: number; recipeUserId: string; relyingPartyId: string; webauthnCredentialId: string }[]; status: "OK" }>
    • Parameters

      • input: { recipeUserId: string; userContext: UserContext }
        • recipeUserId: string
        • userContext: UserContext

      Returns Promise<{ credentials: { createdAt: number; recipeUserId: string; relyingPartyId: string; webauthnCredentialId: string }[]; status: "OK" }>

  • registerCredential:function
    • registerCredential(input: { credential: RegistrationPayload; recipeUserId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }): Promise<{ status: "OK" } | RegisterCredentialErrorResponse>
    • Parameters

      • input: { credential: RegistrationPayload; recipeUserId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }
        • credential: RegistrationPayload
        • recipeUserId: string
        • userContext: UserContext
        • webauthnGeneratedOptionsId: string

      Returns Promise<{ status: "OK" } | RegisterCredentialErrorResponse>

  • registerOptions:function
    • registerOptions(input: { attestation: Attestation | undefined; origin: string; relyingPartyId: string; relyingPartyName: string; residentKey: ResidentKey | undefined; supportedAlgorithmIds: number[] | undefined; tenantId: string; timeout: number | undefined; userContext: UserContext; userPresence: boolean | undefined; userVerification: UserVerification | undefined } & { recoverAccountToken: string } & { attestation: Attestation | undefined; origin: string; relyingPartyId: string; relyingPartyName: string; residentKey: ResidentKey | undefined; supportedAlgorithmIds: number[] | undefined; tenantId: string; timeout: number | undefined; userContext: UserContext; userPresence: boolean | undefined; userVerification: UserVerification | undefined } & { displayName: string | undefined; email: string }): Promise<{ attestation: Attestation; authenticatorSelection: { requireResidentKey: boolean; residentKey: ResidentKey; userVerification: UserVerification }; challenge: string; createdAt: string; excludeCredentials: { id: string; transports: ("ble" | "hybrid" | "internal" | "nfc" | "usb")[]; type: "public-key" }[]; expiresAt: string; pubKeyCredParams: { alg: number; type: "public-key" }[]; rp: { id: string; name: string }; status: "OK"; timeout: number; user: { displayName: string; id: string; name: string }; webauthnGeneratedOptionsId: string } | RegisterOptionsErrorResponse>
    • Parameters

      • input: { attestation: Attestation | undefined; origin: string; relyingPartyId: string; relyingPartyName: string; residentKey: ResidentKey | undefined; supportedAlgorithmIds: number[] | undefined; tenantId: string; timeout: number | undefined; userContext: UserContext; userPresence: boolean | undefined; userVerification: UserVerification | undefined } & { recoverAccountToken: string } & { attestation: Attestation | undefined; origin: string; relyingPartyId: string; relyingPartyName: string; residentKey: ResidentKey | undefined; supportedAlgorithmIds: number[] | undefined; tenantId: string; timeout: number | undefined; userContext: UserContext; userPresence: boolean | undefined; userVerification: UserVerification | undefined } & { displayName: string | undefined; email: string }

      Returns Promise<{ attestation: Attestation; authenticatorSelection: { requireResidentKey: boolean; residentKey: ResidentKey; userVerification: UserVerification }; challenge: string; createdAt: string; excludeCredentials: { id: string; transports: ("ble" | "hybrid" | "internal" | "nfc" | "usb")[]; type: "public-key" }[]; expiresAt: string; pubKeyCredParams: { alg: number; type: "public-key" }[]; rp: { id: string; name: string }; status: "OK"; timeout: number; user: { displayName: string; id: string; name: string }; webauthnGeneratedOptionsId: string } | RegisterOptionsErrorResponse>

  • removeCredential:function
    • removeCredential(input: { recipeUserId: string; userContext: UserContext; webauthnCredentialId: string }): Promise<{ status: "OK" } | RemoveCredentialErrorResponse>
    • Parameters

      • input: { recipeUserId: string; userContext: UserContext; webauthnCredentialId: string }
        • recipeUserId: string
        • userContext: UserContext
        • webauthnCredentialId: string

      Returns Promise<{ status: "OK" } | RemoveCredentialErrorResponse>

  • removeGeneratedOptions:function
    • removeGeneratedOptions(input: { tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }): Promise<{ status: "OK" } | RemoveGeneratedOptionsErrorResponse>
    • Parameters

      • input: { tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }
        • tenantId: string
        • userContext: UserContext
        • webauthnGeneratedOptionsId: string

      Returns Promise<{ status: "OK" } | RemoveGeneratedOptionsErrorResponse>

  • signIn:function
    • signIn(input: { credential: AuthenticationPayload; session: SessionContainer | undefined; shouldTryLinkingWithSessionUser: boolean | undefined; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | SignInErrorResponse>
    • Parameters

      • input: { credential: AuthenticationPayload; session: SessionContainer | undefined; shouldTryLinkingWithSessionUser: boolean | undefined; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }
        • credential: AuthenticationPayload
        • session: SessionContainer | undefined
        • shouldTryLinkingWithSessionUser: boolean | undefined
        • tenantId: string
        • userContext: UserContext
        • webauthnGeneratedOptionsId: string

      Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | SignInErrorResponse>

  • signInOptions:function
    • signInOptions(input: { origin: string; relyingPartyId: string; relyingPartyName: string; tenantId: string; timeout: number | undefined; userContext: UserContext; userPresence: boolean | undefined; userVerification: UserVerification | undefined }): Promise<{ challenge: string; createdAt: string; expiresAt: string; status: "OK"; timeout: number; userVerification: UserVerification; webauthnGeneratedOptionsId: string } | SignInOptionsErrorResponse>
    • Parameters

      • input: { origin: string; relyingPartyId: string; relyingPartyName: string; tenantId: string; timeout: number | undefined; userContext: UserContext; userPresence: boolean | undefined; userVerification: UserVerification | undefined }
        • origin: string
        • relyingPartyId: string
        • relyingPartyName: string
        • tenantId: string
        • timeout: number | undefined
        • userContext: UserContext
        • userPresence: boolean | undefined
        • userVerification: UserVerification | undefined

      Returns Promise<{ challenge: string; createdAt: string; expiresAt: string; status: "OK"; timeout: number; userVerification: UserVerification; webauthnGeneratedOptionsId: string } | SignInOptionsErrorResponse>

  • signUp:function
    • signUp(input: { credential: RegistrationPayload; session: SessionContainer | undefined; shouldTryLinkingWithSessionUser: boolean | undefined; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | SignUpErrorResponse>
    • Parameters

      • input: { credential: RegistrationPayload; session: SessionContainer | undefined; shouldTryLinkingWithSessionUser: boolean | undefined; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }
        • credential: RegistrationPayload
        • session: SessionContainer | undefined
        • shouldTryLinkingWithSessionUser: boolean | undefined
        • tenantId: string
        • userContext: UserContext
        • webauthnGeneratedOptionsId: string

      Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | SignUpErrorResponse>

  • updateUserEmail:function
    • updateUserEmail(input: { email: string; recipeUserId: string; tenantId: string; userContext: UserContext }): Promise<{ status: "OK" } | UpdateUserEmailErrorResponse>
    • Parameters

      • input: { email: string; recipeUserId: string; tenantId: string; userContext: UserContext }
        • email: string
        • recipeUserId: string
        • tenantId: string
        • userContext: UserContext

      Returns Promise<{ status: "OK" } | UpdateUserEmailErrorResponse>

  • verifyCredentials:function
    • verifyCredentials(input: { credential: AuthenticationPayload; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }): Promise<VerifyCredentialsErrorResponse | { recipeUserId: RecipeUserId; status: "OK"; user: User }>
    • Parameters

      • input: { credential: AuthenticationPayload; tenantId: string; userContext: UserContext; webauthnGeneratedOptionsId: string }
        • credential: AuthenticationPayload
        • tenantId: string
        • userContext: UserContext
        • webauthnGeneratedOptionsId: string

      Returns Promise<VerifyCredentialsErrorResponse | { recipeUserId: RecipeUserId; status: "OK"; user: User }>

Variables

Error: typeof default = Wrapper.Error

Functions

  • consumeRecoverAccountToken(input: { tenantId: string; token: string; userContext?: Record<string, any> }): Promise<{ email: string; status: "OK"; userId: string } | ConsumeRecoverAccountTokenErrorResponse>
  • Parameters

    • input: { tenantId: string; token: string; userContext?: Record<string, any> }
      • tenantId: string
      • token: string
      • Optional userContext?: Record<string, any>

    Returns Promise<{ email: string; status: "OK"; userId: string } | ConsumeRecoverAccountTokenErrorResponse>

  • createRecoverAccountLink(__namedParameters: { email: string; tenantId: string; userContext?: Record<string, any>; userId: string }): Promise<GenerateRecoverAccountTokenErrorResponse | { link: string; status: string }>
  • Parameters

    • __namedParameters: { email: string; tenantId: string; userContext?: Record<string, any>; userId: string }
      • email: string
      • tenantId: string
      • Optional userContext?: Record<string, any>
      • userId: string

    Returns Promise<GenerateRecoverAccountTokenErrorResponse | { link: string; status: string }>

  • generateRecoverAccountToken(input: { email: string; tenantId: string; userContext?: Record<string, any>; userId: string }): Promise<{ status: "OK"; token: string } | GenerateRecoverAccountTokenErrorResponse>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: Record<string, any>; userId: string }
      • email: string
      • tenantId: string
      • Optional userContext?: Record<string, any>
      • userId: string

    Returns Promise<{ status: "OK"; token: string } | GenerateRecoverAccountTokenErrorResponse>

  • getCredential(input: { recipeUserId: string; userContext?: Record<string, any>; webauthnCredentialId: string }): Promise<{ createdAt: number; recipeUserId: RecipeUserId; relyingPartyId: string; status: "OK"; webauthnCredentialId: string } | GetCredentialErrorResponse>
  • Parameters

    • input: { recipeUserId: string; userContext?: Record<string, any>; webauthnCredentialId: string }
      • recipeUserId: string
      • Optional userContext?: Record<string, any>
      • webauthnCredentialId: string

    Returns Promise<{ createdAt: number; recipeUserId: RecipeUserId; relyingPartyId: string; status: "OK"; webauthnCredentialId: string } | GetCredentialErrorResponse>

  • getGeneratedOptions(input: { tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }): Promise<{ challenge: string; createdAt: number; email: string; expiresAt: number; origin: string; relyingPartyId: string; relyingPartyName: string; status: "OK"; timeout: string; userPresence: boolean; userVerification: UserVerification; webauthnGeneratedOptionsId: string } | GetGeneratedOptionsErrorResponse>
  • Parameters

    • input: { tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }
      • tenantId: string
      • Optional userContext?: Record<string, any>
      • webauthnGeneratedOptionsId: string

    Returns Promise<{ challenge: string; createdAt: number; email: string; expiresAt: number; origin: string; relyingPartyId: string; relyingPartyName: string; status: "OK"; timeout: string; userPresence: boolean; userVerification: UserVerification; webauthnGeneratedOptionsId: string } | GetGeneratedOptionsErrorResponse>

  • getUserFromRecoverAccountToken(input: { tenantId: string; token: string; userContext?: Record<string, any> }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | GetUserFromRecoverAccountTokenErrorResponse>
  • Parameters

    • input: { tenantId: string; token: string; userContext?: Record<string, any> }
      • tenantId: string
      • token: string
      • Optional userContext?: Record<string, any>

    Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | GetUserFromRecoverAccountTokenErrorResponse>

  • init(config?: TypeInput): RecipeListFunction
  • listCredentials(input: { recipeUserId: string; userContext?: Record<string, any> }): Promise<{ credentials: { createdAt: number; recipeUserId: string; relyingPartyId: string; webauthnCredentialId: string }[]; status: "OK" }>
  • Parameters

    • input: { recipeUserId: string; userContext?: Record<string, any> }
      • recipeUserId: string
      • Optional userContext?: Record<string, any>

    Returns Promise<{ credentials: { createdAt: number; recipeUserId: string; relyingPartyId: string; webauthnCredentialId: string }[]; status: "OK" }>

  • recoverAccount(__namedParameters: { credential: RegistrationPayload; tenantId?: string; token: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }): Promise<ConsumeRecoverAccountTokenErrorResponse | { status: "OK" } | RegisterCredentialErrorResponse>
  • Parameters

    • __namedParameters: { credential: RegistrationPayload; tenantId?: string; token: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }
      • credential: RegistrationPayload
      • Optional tenantId?: string
      • token: string
      • Optional userContext?: Record<string, any>
      • webauthnGeneratedOptionsId: string

    Returns Promise<ConsumeRecoverAccountTokenErrorResponse | { status: "OK" } | RegisterCredentialErrorResponse>

  • registerCredential(input: { credential: RegistrationPayload; recipeUserId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }): Promise<{ status: "OK" } | RegisterCredentialErrorResponse>
  • Parameters

    • input: { credential: RegistrationPayload; recipeUserId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }
      • credential: RegistrationPayload
      • recipeUserId: string
      • Optional userContext?: Record<string, any>
      • webauthnGeneratedOptionsId: string

    Returns Promise<{ status: "OK" } | RegisterCredentialErrorResponse>

  • registerOptions(input: { attestation: undefined | Attestation; origin: string; relyingPartyId: string; relyingPartyName: string; residentKey: undefined | ResidentKey; supportedAlgorithmIds: undefined | number[]; tenantId: string; timeout: undefined | number; userContext?: Record<string, any>; userPresence: undefined | boolean; userVerification: undefined | UserVerification } & { recoverAccountToken: string } & { attestation: undefined | Attestation; origin: string; relyingPartyId: string; relyingPartyName: string; residentKey: undefined | ResidentKey; supportedAlgorithmIds: undefined | number[]; tenantId: string; timeout: undefined | number; userContext?: Record<string, any>; userPresence: undefined | boolean; userVerification: undefined | UserVerification } & { displayName: undefined | string; email: string }): Promise<{ attestation: Attestation; authenticatorSelection: { requireResidentKey: boolean; residentKey: ResidentKey; userVerification: UserVerification }; challenge: string; createdAt: string; excludeCredentials: { id: string; transports: ("ble" | "hybrid" | "internal" | "nfc" | "usb")[]; type: "public-key" }[]; expiresAt: string; pubKeyCredParams: { alg: number; type: "public-key" }[]; rp: { id: string; name: string }; status: "OK"; timeout: number; user: { displayName: string; id: string; name: string }; webauthnGeneratedOptionsId: string } | RegisterOptionsErrorResponse>
  • Parameters

    • input: { attestation: undefined | Attestation; origin: string; relyingPartyId: string; relyingPartyName: string; residentKey: undefined | ResidentKey; supportedAlgorithmIds: undefined | number[]; tenantId: string; timeout: undefined | number; userContext?: Record<string, any>; userPresence: undefined | boolean; userVerification: undefined | UserVerification } & { recoverAccountToken: string } & { attestation: undefined | Attestation; origin: string; relyingPartyId: string; relyingPartyName: string; residentKey: undefined | ResidentKey; supportedAlgorithmIds: undefined | number[]; tenantId: string; timeout: undefined | number; userContext?: Record<string, any>; userPresence: undefined | boolean; userVerification: undefined | UserVerification } & { displayName: undefined | string; email: string }

    Returns Promise<{ attestation: Attestation; authenticatorSelection: { requireResidentKey: boolean; residentKey: ResidentKey; userVerification: UserVerification }; challenge: string; createdAt: string; excludeCredentials: { id: string; transports: ("ble" | "hybrid" | "internal" | "nfc" | "usb")[]; type: "public-key" }[]; expiresAt: string; pubKeyCredParams: { alg: number; type: "public-key" }[]; rp: { id: string; name: string }; status: "OK"; timeout: number; user: { displayName: string; id: string; name: string }; webauthnGeneratedOptionsId: string } | RegisterOptionsErrorResponse>

  • removeCredential(input: { recipeUserId: string; userContext?: Record<string, any>; webauthnCredentialId: string }): Promise<{ status: "OK" } | RemoveCredentialErrorResponse>
  • Parameters

    • input: { recipeUserId: string; userContext?: Record<string, any>; webauthnCredentialId: string }
      • recipeUserId: string
      • Optional userContext?: Record<string, any>
      • webauthnCredentialId: string

    Returns Promise<{ status: "OK" } | RemoveCredentialErrorResponse>

  • removeGeneratedOptions(input: { tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }): Promise<{ status: "OK" } | RemoveGeneratedOptionsErrorResponse>
  • Parameters

    • input: { tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }
      • tenantId: string
      • Optional userContext?: Record<string, any>
      • webauthnGeneratedOptionsId: string

    Returns Promise<{ status: "OK" } | RemoveGeneratedOptionsErrorResponse>

  • sendEmail(input: TypeWebauthnRecoverAccountEmailDeliveryInput & { userContext?: Record<string, any> }): Promise<void>
  • sendRecoverAccountEmail(__namedParameters: { email: string; tenantId: string; userContext?: Record<string, any>; userId: string }): Promise<{ link: string; status: string } | { status: string }>
  • Parameters

    • __namedParameters: { email: string; tenantId: string; userContext?: Record<string, any>; userId: string }
      • email: string
      • tenantId: string
      • Optional userContext?: Record<string, any>
      • userId: string

    Returns Promise<{ link: string; status: string } | { status: string }>

  • signIn(input: { credential: AuthenticationPayload; session: undefined | SessionContainer; shouldTryLinkingWithSessionUser: undefined | boolean; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | SignInErrorResponse>
  • Parameters

    • input: { credential: AuthenticationPayload; session: undefined | SessionContainer; shouldTryLinkingWithSessionUser: undefined | boolean; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }
      • credential: AuthenticationPayload
      • session: undefined | SessionContainer
      • shouldTryLinkingWithSessionUser: undefined | boolean
      • tenantId: string
      • Optional userContext?: Record<string, any>
      • webauthnGeneratedOptionsId: string

    Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | SignInErrorResponse>

  • signInOptions(input: { origin: string; relyingPartyId: string; relyingPartyName: string; tenantId: string; timeout: undefined | number; userContext?: Record<string, any>; userPresence: undefined | boolean; userVerification: undefined | UserVerification }): Promise<{ challenge: string; createdAt: string; expiresAt: string; status: "OK"; timeout: number; userVerification: UserVerification; webauthnGeneratedOptionsId: string } | SignInOptionsErrorResponse>
  • Parameters

    • input: { origin: string; relyingPartyId: string; relyingPartyName: string; tenantId: string; timeout: undefined | number; userContext?: Record<string, any>; userPresence: undefined | boolean; userVerification: undefined | UserVerification }
      • origin: string
      • relyingPartyId: string
      • relyingPartyName: string
      • tenantId: string
      • timeout: undefined | number
      • Optional userContext?: Record<string, any>
      • userPresence: undefined | boolean
      • userVerification: undefined | UserVerification

    Returns Promise<{ challenge: string; createdAt: string; expiresAt: string; status: "OK"; timeout: number; userVerification: UserVerification; webauthnGeneratedOptionsId: string } | SignInOptionsErrorResponse>

  • signUp(input: { credential: RegistrationPayload; session: undefined | SessionContainer; shouldTryLinkingWithSessionUser: undefined | boolean; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | SignUpErrorResponse>
  • Parameters

    • input: { credential: RegistrationPayload; session: undefined | SessionContainer; shouldTryLinkingWithSessionUser: undefined | boolean; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }
      • credential: RegistrationPayload
      • session: undefined | SessionContainer
      • shouldTryLinkingWithSessionUser: undefined | boolean
      • tenantId: string
      • Optional userContext?: Record<string, any>
      • webauthnGeneratedOptionsId: string

    Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | SignUpErrorResponse>

  • updateUserEmail(input: { email: string; recipeUserId: string; tenantId: string; userContext?: Record<string, any> }): Promise<{ status: "OK" } | UpdateUserEmailErrorResponse>
  • Parameters

    • input: { email: string; recipeUserId: string; tenantId: string; userContext?: Record<string, any> }
      • email: string
      • recipeUserId: string
      • tenantId: string
      • Optional userContext?: Record<string, any>

    Returns Promise<{ status: "OK" } | UpdateUserEmailErrorResponse>

  • verifyCredentials(input: { credential: AuthenticationPayload; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "INVALID_CREDENTIALS_ERROR" | "INVALID_OPTIONS_ERROR" | "INVALID_AUTHENTICATOR_ERROR" | "CREDENTIAL_NOT_FOUND_ERROR" | "OPTIONS_NOT_FOUND_ERROR" }>
  • Parameters

    • input: { credential: AuthenticationPayload; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string }
      • credential: AuthenticationPayload
      • tenantId: string
      • Optional userContext?: Record<string, any>
      • webauthnGeneratedOptionsId: string

    Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "INVALID_CREDENTIALS_ERROR" | "INVALID_OPTIONS_ERROR" | "INVALID_AUTHENTICATOR_ERROR" | "CREDENTIAL_NOT_FOUND_ERROR" | "OPTIONS_NOT_FOUND_ERROR" }>

Generated using TypeDoc