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

APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { code: string; options: APIOptions; state: string; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>); signInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: APIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | GeneralErrorResponse>) }

Type declaration

  • appleRedirectHandlerPOST: undefined | ((input: { code: string; options: APIOptions; state: string; userContext: any }) => Promise<void>)
  • authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
  • signInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: APIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | GeneralErrorResponse>)
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; providers: TypeProvider[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

RecipeInterface: { getUserById: any; getUserByThirdPartyInfo: any; getUsersByEmail: any; signInUp: any }

Type declaration

  • getUserById:function
    • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
  • getUserByThirdPartyInfo:function
    • getUserByThirdPartyInfo(input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<undefined | User>
    • Parameters

      • input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }
        • thirdPartyId: string
        • thirdPartyUserId: string
        • userContext: any

      Returns Promise<undefined | User>

  • getUsersByEmail:function
    • getUsersByEmail(input: { email: string; userContext: any }): Promise<User[]>
  • signInUp:function
    • signInUp(input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
    • Parameters

      • input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
        • email: string
        • thirdPartyId: string
        • thirdPartyUserId: string
        • userContext: any

      Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

TypeProvider: { id: string; isDefault?: boolean; get: any }

Type declaration

  • id: string
  • Optional isDefault?: boolean
  • get:function
    • get(redirectURI: undefined | string, authCodeFromRequest: undefined | string, userContext: any): TypeProviderGetResponse
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: typeof default = Wrapper.Error

Functions

  • Apple(config: TypeThirdPartyProviderAppleConfig): TypeProvider
  • Discord(config: TypeThirdPartyProviderDiscordConfig): TypeProvider
  • Facebook(config: TypeThirdPartyProviderFacebookConfig): TypeProvider
  • Github(config: TypeThirdPartyProviderGithubConfig): TypeProvider
  • Google(config: TypeThirdPartyProviderGoogleConfig): TypeProvider
  • GoogleWorkspaces(config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
  • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
  • init(config: TypeInput): RecipeListFunction
  • signInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
  • Parameters

    • thirdPartyId: string
    • thirdPartyUserId: string
    • email: string
    • userContext: any = {}

    Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

Generated using TypeDoc