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

Index

References

PasswordlessAuth

Renames and re-exports __type

Type aliases

GetRedirectionURLContext

GetRedirectionURLContext: AuthRecipeModuleGetRedirectionURLContext

OnHandleEventContext

OnHandleEventContext: { action: "SUCCESS"; isNewUser: boolean; user: PasswordlessUser } | { action: "PASSWORDLESS_RESTART_FLOW" } | { action: "PASSWORDLESS_CODE_SENT"; isResend: boolean } | AuthRecipeModuleOnHandleEventContext

PreAPIHookContext

PreAPIHookContext: { action: "PASSWORDLESS_CREATE_CODE" | "PASSWORDLESS_CONSUME_CODE" | "PASSWORDLESS_RESEND_CODE" | "EMAIL_EXISTS" | "PHONE_NUMBER_EXISTS"; requestInit: RequestInit; url: string }

Type declaration

  • action: "PASSWORDLESS_CREATE_CODE" | "PASSWORDLESS_CONSUME_CODE" | "PASSWORDLESS_RESEND_CODE" | "EMAIL_EXISTS" | "PHONE_NUMBER_EXISTS"
  • requestInit: RequestInit
  • url: string

RecipeInterface

RecipeInterface: { clearLoginAttemptInfo: any; consumeCode: any; createCode: any; doesEmailExist: any; doesPhoneNumberExist: any; getLoginAttemptInfo: any; resendCode: any; setLoginAttemptInfo: any }

Type declaration

  • clearLoginAttemptInfo:function
    • clearLoginAttemptInfo(): void | Promise<void>
  • consumeCode:function
    • consumeCode(input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { config: NormalisedConfig }) | ({ linkCode: string; preAuthSessionId: string } & { config: NormalisedConfig })): Promise<{ createdUser: boolean; status: "OK"; user: PasswordlessUser } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { message: string; status: "GENERAL_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { config: NormalisedConfig }) | ({ linkCode: string; preAuthSessionId: string } & { config: NormalisedConfig })

      Returns Promise<{ createdUser: boolean; status: "OK"; user: PasswordlessUser } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { message: string; status: "GENERAL_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode:function
    • createCode(input: ({ email: string } & { config: NormalisedConfig }) | ({ phoneNumber: string } & { config: NormalisedConfig })): Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { message: string; status: "GENERAL_ERROR" }>
    • Parameters

      • input: ({ email: string } & { config: NormalisedConfig }) | ({ phoneNumber: string } & { config: NormalisedConfig })

      Returns Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { message: string; status: "GENERAL_ERROR" }>

  • doesEmailExist:function
    • doesEmailExist(input: { config: NormalisedConfig; email: string }): Promise<boolean>
  • doesPhoneNumberExist:function
    • doesPhoneNumberExist(input: { config: NormalisedConfig; phoneNumber: string }): Promise<boolean>
  • getLoginAttemptInfo:function
    • getLoginAttemptInfo(): undefined | Promise<undefined | { contactInfo: string; contactMethod: "EMAIL" | "PHONE"; deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; lastResend: number; preAuthSessionId: string; redirectToPath?: string }> | { contactInfo: string; contactMethod: "EMAIL" | "PHONE"; deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; lastResend: number; preAuthSessionId: string; redirectToPath?: string }
    • Returns undefined | Promise<undefined | { contactInfo: string; contactMethod: "EMAIL" | "PHONE"; deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; lastResend: number; preAuthSessionId: string; redirectToPath?: string }> | { contactInfo: string; contactMethod: "EMAIL" | "PHONE"; deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; lastResend: number; preAuthSessionId: string; redirectToPath?: string }

  • resendCode:function
    • resendCode(input: { deviceId: string; preAuthSessionId: string } & { config: NormalisedConfig }): Promise<{ status: "OK" | "RESTART_FLOW_ERROR" } | { message: string; status: "GENERAL_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string } & { config: NormalisedConfig }

      Returns Promise<{ status: "OK" | "RESTART_FLOW_ERROR" } | { message: string; status: "GENERAL_ERROR" }>

  • setLoginAttemptInfo:function
    • setLoginAttemptInfo(input: { contactInfo: string; contactMethod: "EMAIL" | "PHONE"; deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; lastResend: number; preAuthSessionId: string; redirectToPath?: string }): void | Promise<void>
    • Parameters

      • input: { contactInfo: string; contactMethod: "EMAIL" | "PHONE"; deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; lastResend: number; preAuthSessionId: string; redirectToPath?: string }
        • contactInfo: string
        • contactMethod: "EMAIL" | "PHONE"
        • deviceId: string
        • flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"
        • lastResend: number
        • preAuthSessionId: string
        • Optional redirectToPath?: string

      Returns void | Promise<void>

UserInput

UserInput: ({ contactMethod: "EMAIL"; signInUpFeature?: SignInUpFeatureConfigInput; validateEmailAddress?: any } | { contactMethod: "PHONE"; signInUpFeature?: SignInUpFeatureConfigInput & { defaultCountry?: CountryCode }; validatePhoneNumber?: any } | { contactMethod: "EMAIL_OR_PHONE"; signInUpFeature?: SignInUpFeatureConfigInput & { defaultCountry?: CountryCode; guessInternationPhoneNumberFromInputPhoneNumber?: any }; validateEmailAddress?: any; validatePhoneNumber?: any }) & { linkClickedScreenFeature?: PasswordlessFeatureBaseConfig; override?: { components?: ComponentOverrideMap; functions?: any } } & AuthRecipeModuleUserInput<GetRedirectionURLContext, PreAPIHookContext, OnHandleEventContext>

Functions

Const LinkClicked

  • LinkClicked(prop?: any): Element

Const SignInUp

  • SignInUp(prop?: any): Element

Const SignInUpTheme

  • SignInUpTheme(props: SignInUpProps): JSX.Element

Const init

Const redirectToAuth

  • redirectToAuth(input?: "signin" | "signup" | { redirectBack?: false | true; show?: "signin" | "signup" }): Promise<void>

Const signOut

  • signOut(): Promise<void>

Generated using TypeDoc