Skip to main content
References

ThirdParty

Classes

default

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:30

Constructors

Constructor
new default(): default;
Returns

default

Methods

getAuthorisationURLWithQueryParamsAndSetState()
static getAuthorisationURLWithQueryParamsAndSetState(input): Promise<string>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:76

Get the URL that should be opened for third party authentication

Parameters
ParameterType
input{ frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; shouldTryLinkingWithSessionUser?: boolean; thirdPartyId: string; userContext?: any; }
input.frontendRedirectURIstring
input.options?RecipeFunctionOptions
input.redirectURIOnProviderDashboard?string
input.shouldTryLinkingWithSessionUser?boolean
input.thirdPartyIdstring
input.userContext?any
Returns

Promise<string>

URL string

Throws

STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

getStateAndOtherInfoFromStorage()
static getStateAndOtherInfoFromStorage<CustomStateProperties>(input?): StateObject & CustomStateProperties;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:48

Get the current login state from storage, this is also used when calling signInUp

Type Parameters
Type Parameter
CustomStateProperties
Parameters
ParameterType
input?{ userContext?: any; }
input.userContext?any
Returns

StateObject & CustomStateProperties

State object from storage

init()
static init(config?): CreateRecipeFunction<PreAndPostAPIHookAction>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:31

Parameters
ParameterType
config?UserInput
Returns

CreateRecipeFunction<PreAndPostAPIHookAction>

signInAndUp()
static signInAndUp(input?): Promise<
| {
createdNewRecipeUser: boolean;
fetchResponse: Response;
status: "OK";
user: User;
}
| {
fetchResponse: Response;
status: "NO_EMAIL_GIVEN_BY_PROVIDER";
}
| {
fetchResponse: Response;
reason: string;
status: "SIGN_IN_UP_NOT_ALLOWED";
}>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:109

Sign up/Sign in the user, this method uses the login attempt information from storage

Parameters
ParameterType
input?{ options?: RecipeFunctionOptions; userContext?: any; }
input.options?RecipeFunctionOptions
input.userContext?any
Returns

Promise< | { createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User; } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER"; } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED"; }>

{status: OK, user, createdNewRecipeUser: boolean} if successful

Throws

STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

signOut()
static signOut(input?): Promise<void>;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:35

Parameters
ParameterType
input?{ userContext?: any; }
input.userContext?any
Returns

Promise<void>

Variables

getAuthorisationURLWithQueryParamsAndSetState()

const getAuthorisationURLWithQueryParamsAndSetState: (input) => Promise<string> = RecipeWrapper.getAuthorisationURLWithQueryParamsAndSetState;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:134

Get the URL that should be opened for third party authentication

Parameters

ParameterType
input{ frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; shouldTryLinkingWithSessionUser?: boolean; thirdPartyId: string; userContext?: any; }
input.frontendRedirectURIstring
input.options?RecipeFunctionOptions
input.redirectURIOnProviderDashboard?string
input.shouldTryLinkingWithSessionUser?boolean
input.thirdPartyIdstring
input.userContext?any

Returns

Promise<string>

URL string

Throws

STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

getStateAndOtherInfoFromStorage()

const getStateAndOtherInfoFromStorage: <CustomStateProperties>(input?) => StateObject & CustomStateProperties = RecipeWrapper.getStateAndOtherInfoFromStorage;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:135

Get the current login state from storage, this is also used when calling signInUp

Type Parameters

Type Parameter
CustomStateProperties

Parameters

ParameterType
input?{ userContext?: any; }
input.userContext?any

Returns

StateObject & CustomStateProperties

State object from storage

init()

const init: (config?) => CreateRecipeFunction<PreAndPostAPIHookAction> = RecipeWrapper.init;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:133

Parameters

ParameterType
config?UserInput

Returns

CreateRecipeFunction<PreAndPostAPIHookAction>

signInAndUp()

const signInAndUp: (input?) => Promise<
| {
createdNewRecipeUser: boolean;
fetchResponse: Response;
status: "OK";
user: User;
}
| {
fetchResponse: Response;
status: "NO_EMAIL_GIVEN_BY_PROVIDER";
}
| {
fetchResponse: Response;
reason: string;
status: "SIGN_IN_UP_NOT_ALLOWED";
}> = RecipeWrapper.signInAndUp;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:136

Sign up/Sign in the user, this method uses the login attempt information from storage

Parameters

ParameterType
input?{ options?: RecipeFunctionOptions; userContext?: any; }
input.options?RecipeFunctionOptions
input.userContext?any

Returns

Promise< | { createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User; } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER"; } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED"; }>

{status: OK, user, createdNewRecipeUser: boolean} if successful

Throws

STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

signOut()

const signOut: (input?) => Promise<void> = RecipeWrapper.signOut;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:137

Parameters

ParameterType
input?{ userContext?: any; }
input.userContext?any

Returns

Promise<void>

References

PostAPIHookContext

Re-exports PostAPIHookContext

PreAndPostAPIHookAction

Re-exports PreAndPostAPIHookAction

PreAPIHookContext

Re-exports PreAPIHookContext

RecipeFunctionOptions

Re-exports RecipeFunctionOptions

RecipeInterface

Re-exports RecipeInterface

StateObject

Re-exports StateObject

UserInput

Re-exports UserInput