Skip to main content
References

SuperTokens Node Types

Interfaces

HttpRequest

Defined in: types.ts:197

Properties

PropertyTypeDefined in
body?anytypes.ts:202
headersobjecttypes.ts:200
methodHTTPMethodtypes.ts:199
params?Record<string, boolean | number | string | undefined>types.ts:201
urlstringtypes.ts:198

JSONObject

Defined in: types.ts:223

Indexable

[ind: string]: JSONValue

Type Aliases

AllRecipeConfigs

type AllRecipeConfigs = object;

Defined in: types.ts:90

Properties

PropertyTypeDefined in
accountlinkingTypeInput & objecttypes.ts:91
dashboardTypeInputtypes.ts:92
emailpasswordTypeInputtypes.ts:93
emailverificationTypeInputtypes.ts:94
jwtTypeInputtypes.ts:95
multifactorauthTypeInputtypes.ts:96
multitenancyTypeInputtypes.ts:97
oauth2providerTypeInputtypes.ts:98
openidTypeInputtypes.ts:99
passwordlessTypeInputtypes.ts:100
sessionSessionTypeInputtypes.ts:101
thirdpartyTypeInputtypes.ts:102
totpTypeInputtypes.ts:103
usermetadataTypeInputtypes.ts:104
userrolesTypeInputtypes.ts:105
webauthnTypeInputtypes.ts:106

APIHandled

type APIHandled = object;

Defined in: types.ts:211

Properties

PropertyTypeDefined in
disabledbooleantypes.ts:215
idstringtypes.ts:214
methodHTTPMethodtypes.ts:213
pathWithoutApiBasePathNormalisedURLPathtypes.ts:212

AppInfo

type AppInfo = object;

Defined in: types.ts:62

Properties

PropertyTypeDefined in
apiBasePath?stringtypes.ts:68
apiDomainstringtypes.ts:67
apiGatewayPath?stringtypes.ts:69
appNamestringtypes.ts:63
origin?string | (input) => stringtypes.ts:65
websiteBasePath?stringtypes.ts:66
websiteDomain?stringtypes.ts:64

Entries<T>

type Entries<T> = { [K in keyof T]-?: [K, T[K]] }[keyof T][];

Defined in: types.ts:53

Type Parameters

Type Parameter
T

GeneralErrorResponse

type GeneralErrorResponse = object;

Defined in: types.ts:226

Properties

PropertyTypeDefined in
messagestringtypes.ts:228
status"GENERAL_ERROR"types.ts:227

HTTPMethod

type HTTPMethod = "post" | "get" | "delete" | "put" | "patch" | "options" | "trace";

Defined in: types.ts:218

JSONArray

type JSONArray = JSONValue[];

Defined in: types.ts:221

JSONPrimitive

type JSONPrimitive = string | number | boolean | null;

Defined in: types.ts:220

JSONValue

type JSONValue = 
| JSONPrimitive
| JSONObject
| JSONArray
| undefined;

Defined in: types.ts:222

NetworkInterceptor()

type NetworkInterceptor = (request, userContext) => HttpRequest;

Defined in: types.ts:195

Parameters

ParameterType
requestHttpRequest
userContextUserContext

Returns

HttpRequest

NonNullableProperties<T>

type NonNullableProperties<T> = { [P in keyof T]: NonNullable<T[P]> };

Defined in: types.ts:49

Type Parameters

Type Parameter
T

NonPublicConfigPropertiesType

type NonPublicConfigPropertiesType = typeof nonPublicConfigProperties[number];

Defined in: types.ts:163

NormalisedAppinfo

type NormalisedAppinfo = object;

Defined in: types.ts:72

Properties

PropertyTypeDefined in
apiBasePathNormalisedURLPathtypes.ts:78
apiDomainNormalisedURLDomaintypes.ts:75
apiGatewayPathNormalisedURLPathtypes.ts:79
appNamestringtypes.ts:73
getOrigin(input) => NormalisedURLDomaintypes.ts:74
getTopLevelWebsiteDomain(input) => stringtypes.ts:77
topLevelAPIDomainstringtypes.ts:76
websiteBasePathNormalisedURLPathtypes.ts:80

PluginRouteHandler

type PluginRouteHandler = object;

Defined in: types.ts:115

Properties

PropertyTypeDefined in
handler(req, res, session, userContext) => Promise< | { body: JSONObject; status: number; } | null>types.ts:119
methodHTTPMethodtypes.ts:116
pathstringtypes.ts:117
verifySessionOptions?VerifySessionOptionstypes.ts:118

RecipeListFunction()

type RecipeListFunction = (appInfo, isInServerlessEnv, overrideMaps) => RecipeModule;

Defined in: types.ts:205

Parameters

ParameterType
appInfoNormalisedAppinfo
isInServerlessEnvboolean
overrideMapsNonNullable<SuperTokensPlugin["overrideMap"]>[]

Returns

RecipeModule

RecipePluginOverride<T>

type RecipePluginOverride<T> = object;

Defined in: types.ts:109

Type Parameters

Type Parameter
T extends keyof AllRecipeConfigs

Properties

PropertyTypeDefined in
apis?NonNullable<AllRecipeConfigs[T]["override"]>["apis"]types.ts:111
config?(config) => AllRecipeConfigs[T]types.ts:112
functions?NonNullable<AllRecipeConfigs[T]["override"]>["functions"]types.ts:110

SuperTokensConfigWithNormalisedAppInfo

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

Defined in: types.ts:165

Type Declaration

NameTypeDefined in
appInfoNormalisedAppinfotypes.ts:166

SuperTokensInfo

type SuperTokensInfo = object;

Defined in: types.ts:83

Properties

PropertyTypeDefined in
apiKey?stringtypes.ts:85
connectionURIstringtypes.ts:84
disableCoreCallCache?booleantypes.ts:87
networkInterceptor?NetworkInterceptortypes.ts:86

SuperTokensPlugin

type SuperTokensPlugin = object;

Defined in: types.ts:130

Properties

PropertyTypeDefined in
compatibleSDKVersions?string | string[]types.ts:133
config?(config) => | Omit<SuperTokensPublicConfig, "appInfo"> | undefinedtypes.ts:152
dependencies?(config, pluginsAbove, sdkVersion) => | { pluginsToAdd?: SuperTokensPlugin[]; status: "OK"; } | { message: string; status: "ERROR"; }types.ts:135
exports?Record<string, any>types.ts:153
idstringtypes.ts:131
init?(config, allPlugins, sdkVersion) => voidtypes.ts:134
overrideMap?{ [recipeId in keyof AllRecipeConfigs]?: RecipePluginOverride<recipeId> & { recipeInitRequired?: boolean | ((sdkVersion: string) => boolean) } }types.ts:140
routeHandlers?| (config, allPlugins, sdkVersion) => | { routeHandlers: PluginRouteHandler[]; status: "OK"; } | { message: string; status: "ERROR"; } | PluginRouteHandler[]types.ts:145
version?stringtypes.ts:132

SuperTokensPublicConfig

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

Defined in: types.ts:169

Type Declaration

NameTypeDefined in
appInfoNormalisedAppinfotypes.ts:170

SuperTokensPublicPlugin

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

Defined in: types.ts:156

Type Declaration

NameTypeDefined in
initializedbooleantypes.ts:159

TypeInput

type TypeInput = object;

Defined in: types.ts:173

Properties

PropertyTypeDescriptionDefined in
appInfoAppInfo-types.ts:176
debug?boolean-types.ts:180
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/discordtypes.ts:190
experimental.plugins?SuperTokensPlugin[]-types.ts:191
framework?TypeFramework-types.ts:175
isInServerlessEnv?boolean-types.ts:179
recipeListRecipeListFunction[]-types.ts:177
supertokens?SuperTokensInfo-types.ts:174
telemetry?boolean-types.ts:178

User

type User = object;

Defined in: types.ts:231

Properties

PropertyTypeDefined in
emailsstring[]types.ts:236
idstringtypes.ts:232
isPrimaryUserbooleantypes.ts:234
loginMethodsRecipeLevelUser & object[]types.ts:245
phoneNumbersstring[]types.ts:237
tenantIdsstring[]types.ts:235
thirdPartyobject[]types.ts:238
timeJoinednumbertypes.ts:233
toJson() => anytypes.ts:257
webauthnobjecttypes.ts:242
webauthn.credentialIdsstring[]types.ts:243

UserContext

type UserContext = Branded<Record<string, any>, "UserContext">;

Defined in: types.ts:60

Variables

nonPublicConfigProperties

const nonPublicConfigProperties: readonly ["recipeList", "experimental"];

Defined in: types.ts:161