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

Index

References

TypeProvider

Re-exports TypeProvider

Type aliases

EmailPasswordAPIOptions

EmailPasswordAPIOptions: APIOptions

ThirdPartyAPIOptions

ThirdPartyAPIOptions: APIOptions

User

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

Type declaration

  • email: string
  • id: string
  • Optional 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" }>

createResetPasswordToken

  • createResetPasswordToken(userId: string): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_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>

resetPasswordUsingToken

  • resetPasswordUsingToken(token: string, newPassword: string): Promise<{ status: "OK" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

revokeEmailVerificationTokens

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

signIn

  • signIn(email: string, password: string): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>

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

signUp

  • signUp(email: string, password: string): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

unverifyEmail

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

updateEmailOrPassword

  • updateEmailOrPassword(input: { email?: string; password?: string; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
  • Parameters

    • input: { email?: string; password?: string; userId: string }
      • Optional email?: string
      • Optional password?: string
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>

verifyEmailUsingToken

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

Generated using TypeDoc