Options
All
  • Public
  • Public/Protected
  • All
Menu

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/emailverification

Index

References

RecipeFunctionOptions

Re-exports RecipeFunctionOptions

Type aliases

PostAPIHookContext

PostAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>

PreAPIHookContext

PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>

RecipeInterface

RecipeInterface: { getEmailVerificationTokenFromURL: any; isEmailVerified: any; sendVerificationEmail: any; verifyEmail: any }

Type declaration

  • getEmailVerificationTokenFromURL:function
    • getEmailVerificationTokenFromURL(input: { userContext: any }): string
    • Reads and returns the email verification token from the current URL

      Parameters

      • input: { userContext: any }
        • userContext: any

      Returns string

      The "token" query parameter from the current location

  • isEmailVerified:function
    • isEmailVerified(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • sendVerificationEmail:function
    • sendVerificationEmail(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK" }>
    • Send an email to the user for verification.

      throws

      STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

      Parameters

      Returns Promise<{ fetchResponse: Response; status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK" }>

      {status: "OK"} if successfull

  • verifyEmail:function
    • verifyEmail(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

UserInput

UserInput: { override?: InputTypeOverride } & RecipeModuleUserInput<PreAndPostAPIHookAction>

Variables

EmailVerificationClaim

EmailVerificationClaim: EmailVerificationClaimClass = ...

Functions

Const getEmailVerificationTokenFromURL

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string

Const init

  • init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>

Const isEmailVerified

  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>

Const sendVerificationEmail

  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>

Const verifyEmail

  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Generated using TypeDoc