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

## Type Aliases

### InputType

```ts check=false reason="Generated API signature"
type InputType = AuthRecipeInputType<PreAndPostAPIHookAction> & UserInput;
```

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

***

### NormalisedInputType

```ts check=false reason="Generated API signature"
type NormalisedInputType = AuthRecipeNormalisedInputType<PreAndPostAPIHookAction> & object;
```

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

#### Type Declaration

| Name | Type | Defined in |
| ------ | ------ | ------ |
| `override` | `object` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:48](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L48) |
| `override.functions()` | (`originalImplementation`, `builder`) => [`RecipeInterface`](#recipeinterface) | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:49](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L49) |

***

### PostAPIHookContext

```ts check=false reason="Generated API signature"
type PostAPIHookContext = RecipePostAPIHookContext<PreAndPostAPIHookAction>;
```

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

***

### PreAndPostAPIHookAction

```ts check=false reason="Generated API signature"
type PreAndPostAPIHookAction = "GET_AUTHORISATION_URL" | "THIRD_PARTY_SIGN_IN_UP";
```

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

***

### PreAPIHookContext

```ts check=false reason="Generated API signature"
type PreAPIHookContext = RecipePreAPIHookContext<PreAndPostAPIHookAction>;
```

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

***

### RecipeInterface

```ts check=false reason="Generated API signature"
type RecipeInterface = object;
```

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

#### Properties

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| <a id="generatestatetosendtooauthprovider"></a> `generateStateToSendToOAuthProvider` | (`input?`) => `string` | Generate a new state that will be sent to the third party provider | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:193](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L193) |
| <a id="getautherrorfromurl"></a> `getAuthErrorFromURL` | (`input`) => `string` \| `undefined` | Returns the error from the current URL | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:217](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L217) |
| <a id="getauthorisationurlfrombackend"></a> `getAuthorisationURLFromBackend` | (`input`) => `Promise`\<\{ `fetchResponse`: `Response`; `pkceCodeVerifier?`: `string`; `status`: `"OK"`; `urlWithQueryParams`: `string`; \}\> | Get the URL to be used by the third party provider for redirecting after the auth flow. Also returns PKCE Code Verifier if using PKCE. **Throws** STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:138](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L138) |
| <a id="getauthorisationurlwithqueryparamsandsetstate"></a> `getAuthorisationURLWithQueryParamsAndSetState` | (`input`) => `Promise`\<`string`\> | Get the URL that should be opened for third party authentication **Throws** STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:111](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L111) |
| <a id="getauthstatefromurl"></a> `getAuthStateFromURL` | (`input`) => `string` | Returns the auth state from the current URL | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:226](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L226) |
| <a id="getstateandotherinfofromstorage"></a> `getStateAndOtherInfoFromStorage` | \<`CustomStateProperties`\>(`input`) => [`StateObject`](#stateobject) & `CustomStateProperties` \| `undefined` | Get the current login state from storage, this is also used when calling signInUp | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:74](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L74) |
| <a id="setstateandotherinfotostorage"></a> `setStateAndOtherInfoToStorage` | \<`CustomStateProperties`\>(`input`) => `Promise`\<`void`\> | Set the login state to storage | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:85](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L85) |
| <a id="signinandup"></a> `signInAndUp` | (`input`) => `Promise`\< \| \{ `createdNewRecipeUser`: `boolean`; `fetchResponse`: `Response`; `status`: `"OK"`; `tenantId?`: `string`; `user`: [`User`](types#user); \} \| \{ `fetchResponse`: `Response`; `status`: `"NO_EMAIL_GIVEN_BY_PROVIDER"`; \} \| \{ `fetchResponse`: `Response`; `reason`: `string`; `status`: `"SIGN_IN_UP_NOT_ALLOWED"`; \}\> | Sign up/Sign in the user, this method uses the login attempt information from storage **Throws** STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:165](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L165) |
| <a id="verifyandgetstateorthrowerror"></a> `verifyAndGetStateOrThrowError` | \<`CustomStateProperties`\>(`input`) => `Promise`\<[`StateObject`](#stateobject) & `CustomStateProperties`\> | Verify that the state received from the third party provider matches the one in storage | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:204](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L204) |

***

### StateObject

```ts check=false reason="Generated API signature"
type StateObject = object;
```

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

#### Properties

| Property | Type | Defined in |
| ------ | ------ | ------ |
| <a id="expiresat"></a> `expiresAt` | `number` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:60](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L60) |
| <a id="pkcecodeverifier"></a> `pkceCodeVerifier?` | `string` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:63](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L63) |
| <a id="redirecturionproviderdashboard"></a> `redirectURIOnProviderDashboard` | `string` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:61](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L61) |
| <a id="shouldtrylinkingwithsessionuser"></a> `shouldTryLinkingWithSessionUser?` | `boolean` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:62](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L62) |
| <a id="stateforauthprovider"></a> `stateForAuthProvider` | `string` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:57](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L57) |
| <a id="tenantid"></a> `tenantId?` | `string` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:59](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L59) |
| <a id="thirdpartyid"></a> `thirdPartyId` | `string` | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:58](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L58) |

***

### UserInput

```ts check=false reason="Generated API signature"
type UserInput = object & RecipeModuleUserInput<PreAndPostAPIHookAction>;
```

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

#### Type Declaration

| Name | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| `override?` | `object` | Refer to [the documentation](https://supertokens.com/docs/references/frontend-sdks/function-overrides) | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:37](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L37) |
| `override.functions()?` | (`originalImplementation`, `builder`) => [`RecipeInterface`](#recipeinterface) | - | [tmp/supertokens-web-js/lib/ts/recipe/thirdparty/types.ts:38](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/thirdparty/types.ts#L38) |
