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
Bitbucket: typeof Bitbucket = Bitbucket
ComponentsOverrideProvider: FC<PropsWithChildren<{ components: ComponentOverrideMap }>> = RecipeComponentsOverrideContextProvider
Discord: typeof Discord = Discord
Facebook: typeof Facebook = Facebook
Github: typeof Github = Github
Gitlab: typeof Gitlab = Gitlab
Google: typeof Google = Google

Methods

  • 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>

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

    • CustomStateProperties

    Parameters

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

    Returns undefined | StateObject & CustomStateProperties

  • 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" }>

  • 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>

Generated using TypeDoc