Skip to content
Esc
navigateopen⌘Jpreview
Dashboard
On this page

supertokens-node/types

References documentation for the supertokens-node/types package

Interfaces

HttpRequest

Defined in: types.ts

Properties

Property Type Defined in
body? any types.ts
headers object types.ts
method HTTPMethod types.ts
params? Record<string, boolean | number | string | undefined> types.ts
url string types.ts

JSONObject

Defined in: types.ts

Indexable

[ind: string]: JSONValue

Type Aliases

AllRecipeConfigs

type AllRecipeConfigs = object;

Defined in: types.ts

Properties

Property Type Defined in
accountlinking TypeInput & object types.ts
dashboard TypeInput types.ts
emailpassword TypeInput types.ts
emailverification TypeInput types.ts
jwt TypeInput types.ts
multifactorauth TypeInput types.ts
multitenancy TypeInput types.ts
oauth2provider TypeInput types.ts
openid TypeInput types.ts
passwordless TypeInput types.ts
session SessionTypeInput types.ts
thirdparty TypeInput types.ts
totp TypeInput types.ts
usermetadata TypeInput types.ts
userroles TypeInput types.ts
webauthn TypeInput types.ts

APIHandled

type APIHandled = object;

Defined in: types.ts

Properties

Property Type Defined in
disabled boolean types.ts
id string types.ts
method HTTPMethod types.ts
pathWithoutApiBasePath NormalisedURLPath types.ts

AppInfo

type AppInfo = object;

Defined in: types.ts

Properties

Property Type Defined in
apiBasePath? string types.ts
apiDomain string types.ts
apiGatewayPath? string types.ts
appName string types.ts
origin? string | (input) => string types.ts
websiteBasePath? string types.ts
websiteDomain? string types.ts

Entries<T>

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

Defined in: types.ts

Type Parameters

Type Parameter
T

GeneralErrorResponse

type GeneralErrorResponse = object;

Defined in: types.ts

Properties

Property Type Defined in
message string types.ts
status "GENERAL_ERROR" types.ts

HTTPMethod

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

Defined in: types.ts


JSONArray

type JSONArray = JSONValue[];

Defined in: types.ts


JSONPrimitive

type JSONPrimitive = string | number | boolean | null;

Defined in: types.ts


JSONValue

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

Defined in: types.ts


NetworkInterceptor()

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

Defined in: types.ts

Parameters

Parameter Type
request HttpRequest
userContext UserContext

Returns

HttpRequest


NonNullableProperties<T>

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

Defined in: types.ts

Type Parameters

Type Parameter
T

NonPublicConfigPropertiesType

type NonPublicConfigPropertiesType = typeof nonPublicConfigProperties[number];

Defined in: types.ts


NormalisedAppinfo

type NormalisedAppinfo = object;

Defined in: types.ts

Properties

Property Type Defined in
apiBasePath NormalisedURLPath types.ts
apiDomain NormalisedURLDomain types.ts
apiGatewayPath NormalisedURLPath types.ts
appName string types.ts
getOrigin (input) => NormalisedURLDomain types.ts
getTopLevelWebsiteDomain (input) => string types.ts
topLevelAPIDomain string types.ts
websiteBasePath NormalisedURLPath types.ts

PluginRouteHandler

type PluginRouteHandler = object;

Defined in: types.ts

Properties

Property Type Defined in
handler (req, res, session, userContext) => Promise< | { body: JSONObject; status: number; } | null> types.ts
method HTTPMethod types.ts
path string types.ts
verifySessionOptions? VerifySessionOptions types.ts

RecipeListFunction()

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

Defined in: types.ts

Parameters

Parameter Type
appInfo NormalisedAppinfo
isInServerlessEnv boolean
overrideMaps NonNullable<SuperTokensPlugin["overrideMap"]>[]

Returns

RecipeModule


RecipePluginOverride<T>

type RecipePluginOverride<T> = object;

Defined in: types.ts

Type Parameters

Type Parameter
T extends keyof AllRecipeConfigs

Properties

Property Type Defined in
apis? NonNullable<AllRecipeConfigs[T]["override"]>["apis"] types.ts
config? (config) => AllRecipeConfigs[T] types.ts
functions? NonNullable<AllRecipeConfigs[T]["override"]>["functions"] types.ts

SuperTokensConfigWithNormalisedAppInfo

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

Defined in: types.ts

Type Declaration

Name Type Defined in
appInfo NormalisedAppinfo types.ts

SuperTokensInfo

type SuperTokensInfo = object;

Defined in: types.ts

Properties

Property Type Defined in
apiKey? string types.ts
connectionURI string types.ts
disableCoreCallCache? boolean types.ts
networkInterceptor? NetworkInterceptor types.ts

SuperTokensPlugin

type SuperTokensPlugin = object;

Defined in: types.ts

Properties

Property Type Defined in
compatibleSDKVersions? string | string[] types.ts
config? (config) => | Omit<SuperTokensPublicConfig, "appInfo"> | undefined types.ts
dependencies? (config, pluginsAbove, sdkVersion) => | { pluginsToAdd?: SuperTokensPlugin[]; status: "OK"; } | { message: string; status: "ERROR"; } types.ts
exports? Record<string, any> types.ts
id string types.ts
init? (config, allPlugins, sdkVersion) => void types.ts
overrideMap? { [recipeId in keyof AllRecipeConfigs]?: RecipePluginOverride<recipeId> & { recipeInitRequired?: boolean | ((sdkVersion: string) => boolean) } } types.ts
routeHandlers? | (config, allPlugins, sdkVersion) => | { routeHandlers: PluginRouteHandler[]; status: "OK"; } | { message: string; status: "ERROR"; } | PluginRouteHandler[] types.ts
version? string types.ts

SuperTokensPublicConfig

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

Defined in: types.ts

Type Declaration

Name Type Defined in
appInfo NormalisedAppinfo types.ts

SuperTokensPublicPlugin

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

Defined in: types.ts

Type Declaration

Name Type Defined in
initialized boolean types.ts

TypeInput

type TypeInput = object;

Defined in: types.ts

Properties

Property Type Description Defined in
appInfo AppInfo - types.ts
debug? boolean - types.ts
experimental? object Our 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/discord types.ts
experimental.plugins? SuperTokensPlugin[] - types.ts
framework? TypeFramework - types.ts
isInServerlessEnv? boolean - types.ts
recipeList RecipeListFunction[] - types.ts
supertokens? SuperTokensInfo - types.ts
telemetry? boolean - types.ts

User

type User = object;

Defined in: types.ts

Properties

Property Type Defined in
emails string[] types.ts
id string types.ts
isPrimaryUser boolean types.ts
loginMethods RecipeLevelUser & object[] types.ts
phoneNumbers string[] types.ts
tenantIds string[] types.ts
thirdParty object[] types.ts
timeJoined number types.ts
toJson () => any types.ts
webauthn object types.ts
webauthn.credentialIds string[] types.ts

UserContext

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

Defined in: types.ts

Variables

nonPublicConfigProperties

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

Defined in: types.ts

API reference

API schema and response details