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

Hierarchy

  • default

Index

Constructors

Properties

Apple: typeof Apple = Apple
EmailVerificationTheme: ((props: EmailVerificationThemeProps) => JSX.Element) = EmailVerificationTheme

Type declaration

    • (props: EmailVerificationThemeProps): JSX.Element
    • Parameters

      • props: EmailVerificationThemeProps

      Returns JSX.Element

Facebook: typeof Facebook = Facebook
Github: typeof Github = Github
Google: typeof Google = Google
SignInAndUpCallbackTheme: ComponentType<{}> = SignInAndUpCallbackTheme
SignInAndUpTheme: FC<SignInAndUpThemeProps> = SignInAndUpTheme
ThirdPartyAuth: FC<PropsWithChildren<{ requireAuth?: boolean; userContext?: any; onSessionExpired?: any }>> = ThirdPartyAuth

Methods

  • EmailVerification(prop?: any): Element
  • SignInAndUp(prop?: any): Element
  • SignInAndUpCallback(prop?: any): Element
  • generateStateToSendToOAuthProvider(input?: { userContext?: any }): string
  • getAuthCodeFromURL(input?: { userContext?: any }): string
  • getAuthErrorFromURL(input?: { userContext?: any }): undefined | string
  • getAuthStateFromURL(input?: { userContext?: any }): string
  • getAuthorisationURLFromBackend(input: { options?: RecipeFunctionOptions; providerId: string; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; url: string }>
  • Parameters

    • input: { options?: RecipeFunctionOptions; providerId: string; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • providerId: string
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK"; url: string }>

  • getAuthorisationURLWithQueryParamsAndSetState(input: { authorisationURL: string; options?: RecipeFunctionOptions; providerClientId?: string; providerId: string; userContext?: any }): Promise<string>
  • Parameters

    • input: { authorisationURL: string; options?: RecipeFunctionOptions; providerClientId?: string; providerId: string; userContext?: any }
      • authorisationURL: string
      • Optional options?: RecipeFunctionOptions
      • Optional providerClientId?: string
      • providerId: string
      • Optional userContext?: any

    Returns Promise<string>

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
  • Type Parameters

    • CustomStateProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns undefined | StateObject & CustomStateProperties

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

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>

  • redirectToAuth(input?: "signin" | "signup" | { redirectBack?: boolean; show?: "signin" | "signup" }): Promise<void>
  • redirectToThirdPartyLogin(input: { thirdPartyId: string; userContext?: any }): Promise<{ status: "OK" | "ERROR" }>
  • Parameters

    • input: { thirdPartyId: string; userContext?: any }
      • thirdPartyId: string
      • Optional userContext?: any

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

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

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

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

  • setStateAndOtherInfoToStorage<CustomStateProperties>(input: { state: StateObject & CustomStateProperties; userContext?: any }): Promise<void>
  • Type Parameters

    • CustomStateProperties

    Parameters

    • input: { state: StateObject & CustomStateProperties; userContext?: any }
      • state: StateObject & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<void>

  • signInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>
  • Parameters

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ createdNewUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>

  • signOut(input?: { userContext?: any }): Promise<void>
  • verifyAndGetStateOrThrowError<CustomStateProperties>(input: { stateFromAuthProvider: undefined | string; stateObjectFromStorage: undefined | StateObject & CustomStateProperties; userContext?: any }): Promise<StateObject & CustomStateProperties>
  • Type Parameters

    • CustomStateProperties

    Parameters

    • input: { stateFromAuthProvider: undefined | string; stateObjectFromStorage: undefined | StateObject & CustomStateProperties; userContext?: any }
      • stateFromAuthProvider: undefined | string
      • stateObjectFromStorage: undefined | StateObject & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<StateObject & CustomStateProperties>

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

    • Optional input: { options?: RecipeFunctionOptions; userContext?: any }
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

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

Generated using TypeDoc