Skip to main content
References

SuperTokens Web JS Types

Type Aliases

AllRecipeConfigs

type AllRecipeConfigs = object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:207

Properties

AppInfoUserInput

type AppInfoUserInput = object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:113

Properties

PropertyTypeDescriptionDefined in
apiBasePath?stringThe path at which the SuperTokens APIs are exposed by your backend. Defaults to /auth. This value must match the one set in the backend SDKs for SuperTokens to work correctlytmp/supertokens-web-js/lib/ts/types.ts:134
apiDomainstringThe domain at which you host your backend SDKs. This is used by the SDK when making network requests. For example if your API server is running on http://localhost:8080 then when calling SuperTokens.init the value for apiDomain should be set to http://localhost:8080 This value must match the one set in the backend SDKs for SuperTokens to work correctlytmp/supertokens-web-js/lib/ts/types.ts:127
apiGatewayPath?stringAn API gateway may be used which prepends a path to the API route. That path should be specified here.tmp/supertokens-web-js/lib/ts/types.ts:140
appNamestringThe name of your applicationtmp/supertokens-web-js/lib/ts/types.ts:117

CreateRecipeFunction()<Action>

type CreateRecipeFunction<Action> = (appInfo, clientType, enableDebugLogs, overrideMaps) => RecipeModule<Action, NormalisedRecipeConfig<Action>>;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:106

Type Parameters

Type Parameter
Action

Parameters

ParameterType
appInfoNormalisedAppInfo
clientTypestring | undefined
enableDebugLogsboolean
overrideMapsNonNullable<SuperTokensPlugin["overrideMap"]>[]

Returns

RecipeModule<Action, NormalisedRecipeConfig<Action>>

GeneralErrorResponse

type GeneralErrorResponse = object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:201

Properties

NonPublicConfigPropertiesType

type NonPublicConfigPropertiesType = typeof nonPublicConfigProperties[number];

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:246

NormalisedAppInfo

type NormalisedAppInfo = object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:146

Normalised version of the config passed to SuperTokens.init

Properties

PropertyTypeDescriptionDefined in
apiBasePathNormalisedURLPathThe path at which the SuperTokens APIs are exposed by your backend. Defaults to /auth. This value must match the one set in the backend SDKs for SuperTokens to work correctlytmp/supertokens-web-js/lib/ts/types.ts:167
apiDomainNormalisedURLDomainThe domain at which you host your backend SDKs. This is used by the SDK when making network requests. For example if your API server is running on http://localhost:8080 then when calling SuperTokens.init the value for apiDomain should be set to http://localhost:8080 This value must match the one set in the backend SDKs for SuperTokens to work correctlytmp/supertokens-web-js/lib/ts/types.ts:160
appNamestringThe name of your applicationtmp/supertokens-web-js/lib/ts/types.ts:150

RecipePluginOverride<T>

type RecipePluginOverride<T> = object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:220

Type Parameters

Type Parameter
T extends keyof AllRecipeConfigs

Properties

PropertyTypeDefined in
config?(config) => AllRecipeConfigs[T]tmp/supertokens-web-js/lib/ts/types.ts:222
functions?NonNullable<AllRecipeConfigs[T]["override"]>["functions"]tmp/supertokens-web-js/lib/ts/types.ts:221

SuperTokensConfig

type SuperTokensConfig = object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:35

The configuration object to be passed when calling SuperTokens.init

Properties

PropertyTypeDescriptionDefined in
appInfoAppInfoUserInputThe information specific to your application, this helps the SDK understand how SuperTokens is setup in your systemtmp/supertokens-web-js/lib/ts/types.ts:40
clientType?stringIdentifier for the client, such as web, ios, etc. to be used with thirdparty, multitenancy recipes.tmp/supertokens-web-js/lib/ts/types.ts:45
cookieHandler?CookieHandlerInputCustom handlers that the SDK should use when trying to read or write to document.cookie In most cases you should not need to provide these. When provided, the SDK will rely on these functions instead of using document.cookie directly When using this feature, take extra care to use the correct function version (async/async). The interface by default uses async versions of the functions when possible but specific parts of the SDK may rely on using the sync versions instead.tmp/supertokens-web-js/lib/ts/types.ts:63
dateProvider?DateProviderInputCustom provider for SDK timing calculations relative to server time. The default implementation automatically adjusts for client-server time deviation. Typically, you won't need to provide these. If provided, the SDK uses your implementation instead of the default one.tmp/supertokens-web-js/lib/ts/types.ts:85
enableDebugLogs?booleanEnabled logging for the SuperTokens SDK. The SDK will log information in different stages.tmp/supertokens-web-js/lib/ts/types.ts:90
experimental?objectOur experimental features are not yet stable and are subject to change. In practical terms, this means that their interface is subject to change without a major version update. They are also not tested as much as our "normal" features. If you want to use these features, or if you have any feedback please let us know at: https://supertokens.com/discordtmp/supertokens-web-js/lib/ts/types.ts:101
experimental.plugins?SuperTokensPlugin[]-tmp/supertokens-web-js/lib/ts/types.ts:102
recipeListCreateRecipeFunction<any>[]List of recipes that you want to use. Refer to the documentation for the recipe that you want to use to know how this property should be set.tmp/supertokens-web-js/lib/ts/types.ts:51
windowHandler?WindowHandlerInputCustom handlers that the SDK should use when trying to access Window APIs In most cases you should not need to provide these. When provided, the SDK will rely on these functions instead of using any Window APIs directly When using this feature, take extra care to use the correct function version (async/async). The interface by default uses async versions of the functions when possible but specific parts of the SDK may rely on using the sync versions instead.tmp/supertokens-web-js/lib/ts/types.ts:75

SuperTokensConfigWithNormalisedAppInfo

type SuperTokensConfigWithNormalisedAppInfo = Omit<SuperTokensConfig, "appInfo"> & object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:253

Type Declaration

SuperTokensPlugin

type SuperTokensPlugin = object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:225

Properties

PropertyTypeDefined in
compatibleWebJSSDKVersions?string | string[]tmp/supertokens-web-js/lib/ts/types.ts:228
config?(config) => | Omit<SuperTokensPublicConfig, "appInfo"> | undefinedtmp/supertokens-web-js/lib/ts/types.ts:241
dependencies?(config, pluginsAbove, sdkVersion) => | { pluginsToAdd?: SuperTokensPlugin[]; status: "OK"; } | { message: string; status: "ERROR"; }tmp/supertokens-web-js/lib/ts/types.ts:229
exports?Record<string, any>tmp/supertokens-web-js/lib/ts/types.ts:240
idstringtmp/supertokens-web-js/lib/ts/types.ts:226
init?(config, plugins, sdkVersion) => voidtmp/supertokens-web-js/lib/ts/types.ts:239
overrideMap?{ [recipeId in keyof AllRecipeConfigs]?: RecipePluginOverride<recipeId> & { recipeInitRequired?: boolean | ((sdkVersion: string) => boolean) } }tmp/supertokens-web-js/lib/ts/types.ts:234
version?stringtmp/supertokens-web-js/lib/ts/types.ts:227

SuperTokensPublicConfig

type SuperTokensPublicConfig = Omit<Omit<SuperTokensConfig, NonPublicConfigPropertiesType>, "appInfo"> & object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:257

Type Declaration

SuperTokensPublicPlugin

type SuperTokensPublicPlugin = Pick<SuperTokensPlugin, "id" | "version" | "exports" | "compatibleWebJSSDKVersions"> & object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:248

Type Declaration

NameTypeDefined in
initializedbooleantmp/supertokens-web-js/lib/ts/types.ts:251

User

type User = object;

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:170

Properties

Variables

nonPublicConfigProperties

const nonPublicConfigProperties: readonly ["experimental"];

Defined in: tmp/supertokens-web-js/lib/ts/types.ts:244