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: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | GeneralErrorResponse>) }

Type declaration

  • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>)
  • authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
  • signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | GeneralErrorResponse>)
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; providers: ProviderInput[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

  • appInfo: NormalisedAppinfo
  • config: TypeNormalisedInput
  • isInServerlessEnv: boolean
  • providers: ProviderInput[]
  • recipeId: string
  • recipeImplementation: RecipeInterface
  • req: BaseRequest
  • res: BaseResponse
RecipeInterface: { getProvider: any; getUserById: any; getUserByThirdPartyInfo: any; getUsersByEmail: any; manuallyCreateOrUpdateUser: any; signInUp: any }

Type declaration

  • getProvider:function
    • getProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
    • Parameters

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

      Returns Promise<undefined | TypeProvider>

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

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

      Returns Promise<undefined | User>

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

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

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

  • signInUp:function
    • signInUp(input: { email: string; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; status: "OK"; user: User }>
    • Parameters

      • input: { email: string; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
        • email: string
        • oAuthTokens: {}
          • [key: string]: any
        • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
          • Optional fromIdTokenPayload?: {}
            • [key: string]: any
          • Optional fromUserInfoAPI?: {}
            • [key: string]: any
        • tenantId: string
        • thirdPartyId: string
        • thirdPartyUserId: string
        • userContext: any

      Returns Promise<{ createdNewUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; status: "OK"; user: User }>

TypeProvider: { config: ProviderConfigForClientType; id: string; exchangeAuthCodeForOAuthTokens: any; getAuthorisationRedirectURL: any; getConfigForClientType: any; getUserInfo: any }

Type declaration

  • config: ProviderConfigForClientType
  • id: string
  • exchangeAuthCodeForOAuthTokens:function
    • exchangeAuthCodeForOAuthTokens(input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }): Promise<any>
    • Parameters

      • input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }
        • redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }
          • Optional pkceCodeVerifier?: string
          • redirectURIOnProviderDashboard: string
          • redirectURIQueryParams: any
        • userContext: any

      Returns Promise<any>

  • getAuthorisationRedirectURL:function
    • getAuthorisationRedirectURL(input: { redirectURIOnProviderDashboard: string; userContext: any }): Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>
    • Parameters

      • input: { redirectURIOnProviderDashboard: string; userContext: any }
        • redirectURIOnProviderDashboard: string
        • userContext: any

      Returns Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>

  • getConfigForClientType:function
    • getConfigForClientType(input: { clientType?: string; userContext: any }): Promise<ProviderConfigForClientType>
    • Parameters

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

      Returns Promise<ProviderConfigForClientType>

  • getUserInfo:function
    • getUserInfo(input: { oAuthTokens: any; userContext: any }): Promise<UserInfo>
User: { email: string; id: string; tenantIds: string[]; thirdParty: { id: string; userId: string }; timeJoined: number }

Type declaration

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

Variables

Error: typeof default = Wrapper.Error

Functions

  • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • getUserByThirdPartyInfo(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
  • getUsersByEmail(tenantId: string, email: string, userContext?: any): Promise<User[]>
  • init(config?: TypeInput): RecipeListFunction
  • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
  • Parameters

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

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

Generated using TypeDoc