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

Index

Type aliases

APIOptions

APIOptions: { config: TypeNormalisedInput; emailVerificationRecipeImplementation: RecipeInterface; isInServerlessEnv: boolean; providers: TypeProvider[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

TypeProvider

TypeProvider: { id: string; get: any }

Type declaration

  • id: string
  • get:function
    • get(redirectURI: undefined | string, authCodeFromRequest: undefined | string): Promise<TypeProviderGetResponse>

User

User: { email: string; id: string; thirdParty: { id: string; userId: string }; timeJoined: number }

Type declaration

  • email: string
  • id: string
  • thirdParty: { id: string; userId: string }
    • id: string
    • userId: string
  • timeJoined: number

Variables

Error

Error: typeof default = ...

Functions

Apple

  • Apple(config: TypeThirdPartyProviderAppleConfig): TypeProvider

Facebook

  • Facebook(config: TypeThirdPartyProviderFacebookConfig): TypeProvider

Github

  • Github(config: TypeThirdPartyProviderGithubConfig): TypeProvider

Google

  • Google(config: TypeThirdPartyProviderGoogleConfig): TypeProvider

createEmailVerificationToken

  • createEmailVerificationToken(userId: string): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>

getUserById

  • getUserById(userId: string): Promise<undefined | User>

getUserByThirdPartyInfo

  • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string): Promise<undefined | User>

getUsersByEmail

  • getUsersByEmail(email: string): Promise<User[]>

init

  • init(config: TypeInput): RecipeListFunction

isEmailVerified

  • isEmailVerified(userId: string): Promise<boolean>

revokeEmailVerificationTokens

  • revokeEmailVerificationTokens(userId: string): Promise<{ status: "OK" }>

signInUp

  • signInUp(thirdPartyId: string, thirdPartyUserId: string, email: { id: string; isVerified: boolean }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { error: string; status: "FIELD_ERROR" }>
  • Parameters

    • thirdPartyId: string
    • thirdPartyUserId: string
    • email: { id: string; isVerified: boolean }
      • id: string
      • isVerified: boolean

    Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { error: string; status: "FIELD_ERROR" }>

unverifyEmail

  • unverifyEmail(userId: string): Promise<{ status: "OK" }>

verifyEmailUsingToken

  • verifyEmailUsingToken(token: string): Promise<undefined | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | User>

Generated using TypeDoc