---
title: supertokens-web-js/recipe/thirdparty
description: References documentation for the supertokens-web-js/recipe/thirdparty package
sidebar:
  order: 170
---

## Classes

### default

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:30](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L30)

#### Constructors

##### Constructor

```ts check=false reason="Generated API signature"
new default(): default;
```

###### Returns

[`default`](#default)

#### Methods

##### getAuthorisationURLWithQueryParamsAndSetState()

```ts check=false reason="Generated API signature"
static getAuthorisationURLWithQueryParamsAndSetState(input): Promise<string>;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:76](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L76)

Get the URL that should be opened for third party authentication

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `frontendRedirectURI`: `string`; `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `redirectURIOnProviderDashboard?`: `string`; `shouldTryLinkingWithSessionUser?`: `boolean`; `thirdPartyId`: `string`; `userContext?`: `any`; \} |
| `input.frontendRedirectURI` | `string` |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#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()

```ts check=false reason="Generated API signature"
static getStateAndOtherInfoFromStorage<CustomStateProperties>(input?): StateObject & CustomStateProperties;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:48](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L48)

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`](recipe-thirdparty-types#stateobject) & `CustomStateProperties`

State object from storage

##### init()

```ts check=false reason="Generated API signature"
static init(config?): CreateRecipeFunction<PreAndPostAPIHookAction>;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:31](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L31)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | [`UserInput`](recipe-thirdparty-types#userinput) |

###### Returns

[`CreateRecipeFunction`](types#createrecipefunction)\<[`PreAndPostAPIHookAction`](recipe-thirdparty-types#preandpostapihookaction)\>

##### signInAndUp()

```ts check=false reason="Generated API signature"
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](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L109)

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

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions) |
| `input.userContext?` | `any` |

###### Returns

`Promise`\<
  \| \{
  `createdNewRecipeUser`: `boolean`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#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()

```ts check=false reason="Generated API signature"
static signOut(input?): Promise<void>;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:35](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L35)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: `any`; \} |
| `input.userContext?` | `any` |

###### Returns

`Promise`\<`void`\>

## Variables

### getAuthorisationURLWithQueryParamsAndSetState()

```ts check=false reason="Generated API signature"
const getAuthorisationURLWithQueryParamsAndSetState: (input) => Promise<string> = RecipeWrapper.getAuthorisationURLWithQueryParamsAndSetState;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:134](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L134)

Get the URL that should be opened for third party authentication

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `frontendRedirectURI`: `string`; `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `redirectURIOnProviderDashboard?`: `string`; `shouldTryLinkingWithSessionUser?`: `boolean`; `thirdPartyId`: `string`; `userContext?`: `any`; \} |
| `input.frontendRedirectURI` | `string` |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#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()

```ts check=false reason="Generated API signature"
const getStateAndOtherInfoFromStorage: <CustomStateProperties>(input?) => StateObject & CustomStateProperties = RecipeWrapper.getStateAndOtherInfoFromStorage;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:135](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L135)

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`](recipe-thirdparty-types#stateobject) & `CustomStateProperties`

State object from storage

***

### init()

```ts check=false reason="Generated API signature"
const init: (config?) => CreateRecipeFunction<PreAndPostAPIHookAction> = RecipeWrapper.init;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:133](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L133)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | [`UserInput`](recipe-thirdparty-types#userinput) |

#### Returns

[`CreateRecipeFunction`](types#createrecipefunction)\<[`PreAndPostAPIHookAction`](recipe-thirdparty-types#preandpostapihookaction)\>

***

### signInAndUp()

```ts check=false reason="Generated API signature"
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](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L136)

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

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions) |
| `input.userContext?` | `any` |

#### Returns

`Promise`\<
  \| \{
  `createdNewRecipeUser`: `boolean`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#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()

```ts check=false reason="Generated API signature"
const signOut: (input?) => Promise<void> = RecipeWrapper.signOut;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/index.ts:137](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/index.ts#L137)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: `any`; \} |
| `input.userContext?` | `any` |

#### Returns

`Promise`\<`void`\>

## References

### PostAPIHookContext

Re-exports [PostAPIHookContext](recipe-thirdparty-types#postapihookcontext)

***

### PreAndPostAPIHookAction

Re-exports [PreAndPostAPIHookAction](recipe-thirdparty-types#preandpostapihookaction)

***

### PreAPIHookContext

Re-exports [PreAPIHookContext](recipe-thirdparty-types#preapihookcontext)

***

### RecipeFunctionOptions

Re-exports [RecipeFunctionOptions](recipe-emailpassword#recipefunctionoptions)

***

### RecipeInterface

Re-exports [RecipeInterface](recipe-thirdparty-types#recipeinterface)

***

### StateObject

Re-exports [StateObject](recipe-thirdparty-types#stateobject)

***

### UserInput

Re-exports [UserInput](recipe-thirdparty-types#userinput)
