supertokens-web-js/recipe/thirdparty
References documentation for the supertokens-web-js/recipe/thirdparty package
Classes
default
Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts
Constructors
Constructor
new default(): default;
Returns
Methods
getAuthorisationURLWithQueryParamsAndSetState()
static getAuthorisationURLWithQueryParamsAndSetState(input): Promise<string>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts
Get the URL that should be opened for third party authentication
Parameters
| Parameter | Type |
|---|---|
input |
{ frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; shouldTryLinkingWithSessionUser?: boolean; thirdPartyId: string; userContext?: any; } |
input.frontendRedirectURI |
string |
input.options? |
RecipeFunctionOptions |
input.redirectURIOnProviderDashboard? |
string |
input.shouldTryLinkingWithSessionUser? |
boolean |
input.thirdPartyId |
string |
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
Get the current login state from storage, this is also used when calling signInUp
Type Parameters
| Type Parameter |
|---|
CustomStateProperties |
Parameters
| Parameter | Type |
|---|---|
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
Parameters
| Parameter | Type |
|---|---|
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
Sign up/Sign in the user, this method uses the login attempt information from storage
Parameters
| Parameter | Type |
|---|---|
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
Parameters
| Parameter | Type |
|---|---|
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
Get the URL that should be opened for third party authentication
Parameters
| Parameter | Type |
|---|---|
input |
{ frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; shouldTryLinkingWithSessionUser?: boolean; thirdPartyId: string; userContext?: any; } |
input.frontendRedirectURI |
string |
input.options? |
RecipeFunctionOptions |
input.redirectURIOnProviderDashboard? |
string |
input.shouldTryLinkingWithSessionUser? |
boolean |
input.thirdPartyId |
string |
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
Get the current login state from storage, this is also used when calling signInUp
Type Parameters
| Type Parameter |
|---|
CustomStateProperties |
Parameters
| Parameter | Type |
|---|---|
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
Parameters
| Parameter | Type |
|---|---|
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
Sign up/Sign in the user, this method uses the login attempt information from storage
Parameters
| Parameter | Type |
|---|---|
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
Parameters
| Parameter | Type |
|---|---|
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