Skip to content
Esc
navigateopen⌘Jpreview
Dashboard
On this page

supertokens-auth-react/types

References documentation for the supertokens-auth-react/types package

Type Aliases

AllRecipeComponentOverrides

type AllRecipeComponentOverrides = object;

Defined in: types.ts

Properties

Property Type Defined in
authRecipe AuthRecipeComponentOverrideMap types.ts
emailpassword ComponentOverrideMap types.ts
emailverification ComponentOverrideMap types.ts
multifactorauth ComponentOverrideMap types.ts
multitenancy ComponentOverrideMap types.ts
oauth2provider ComponentOverrideMap types.ts
passwordless ComponentOverrideMap types.ts
session ComponentOverrideMap types.ts
thirdparty ComponentOverrideMap types.ts
totp ComponentOverrideMap types.ts
webauthn ComponentOverrideMap types.ts

AllRecipeConfigs

type AllRecipeConfigs = object;

Defined in: types.ts

Properties

Property Type Defined in
emailpassword Config types.ts
emailverification Config types.ts
multifactorauth Config types.ts
multitenancy UserInput types.ts
oauth2provider UserInput types.ts
passwordless Config types.ts
session InputType types.ts
thirdparty Config types.ts
totp Config types.ts
webauthn Config types.ts

APIFormField

type APIFormField = object;

Defined in: types.ts

Properties

Property Type Defined in
id string types.ts
value string types.ts

AppInfoUserInput

type AppInfoUserInput = object;

Defined in: types.ts

Properties

Property Type Description Defined in
apiBasePath? string - types.ts
apiDomain string - types.ts
apiGatewayPath? string An API gateway may be used which prepends a path to the API route. That path should be specified here. types.ts
appName string - types.ts
websiteBasePath? string - types.ts
websiteDomain string - types.ts

AuthComponent<T>

type AuthComponent<T> = 
  | PartialAuthComponent
| FullPageAuthComponent<T>;

Defined in: types.ts

Type Parameters

Type Parameter Default type
T any

AuthComponentProps

type AuthComponentProps = object;

Defined in: types.ts

Properties

Property Type Defined in
children? React.ReactNode types.ts
clearError () => void types.ts
error string | undefined types.ts
navigate Navigate | undefined types.ts
onAuthSuccess (successContext) => Promise<void> types.ts
onError (err) => void types.ts
onSignInUpSwitcherClick () => void types.ts
rebuildAuthPage () => void types.ts
resetFactorList () => void types.ts
setFactorList (factorIds) => void types.ts
showBackButton boolean types.ts
userContext UserContext types.ts

Awaited<T>

type Awaited<T> = T extends null | undefined ? T : T extends object & object ? F extends (value, ...args) => any ? V : never : T;

Defined in: types.ts

Type Parameters

Type Parameter
T

BaseFeatureComponentMap

type BaseFeatureComponentMap = Record<string, ComponentWithRecipeAndMatchingMethod[]>;

Defined in: types.ts


ComponentWithRecipeAndMatchingMethod

type ComponentWithRecipeAndMatchingMethod = object;

Defined in: types.ts

Properties

Property Type Description Defined in
component ReactComponentClass - types.ts
matches () => boolean - types.ts
recipeID string Recipe ID this component belongs types.ts

CreateRecipeFunction()<T, S, R, N>

type CreateRecipeFunction<T, S, R, N> = (appInfo, enableDebugLogs) => BaseRecipeModule<T, S, R, N>;

Defined in: types.ts

Type Parameters

Type Parameter
T
S
R
N extends NormalisedRecipeModuleConfig<T, S, R>

Parameters

Parameter Type
appInfo NormalisedAppInfo
enableDebugLogs boolean

Returns

BaseRecipeModule<T, S, R, N>


FeatureBaseConfig

type FeatureBaseConfig = object;

Defined in: types.ts

Properties

Property Type Defined in
style? string types.ts

FeatureBaseProps<T>

type FeatureBaseProps<T> = PropsWithChildren<object & T>;

Defined in: types.ts

Type Parameters

Type Parameter Default type
T Record<string, unknown>

FormField

type FormField = FormFieldBaseConfig & object;

Defined in: types.ts

Type Declaration

Name Type Defined in
optional? boolean types.ts
validate()? (value) => Promise<string | undefined> types.ts

FormFieldBaseConfig

type FormFieldBaseConfig = object;

Defined in: types.ts

Properties

Property Type Defined in
getDefaultValue? () => string types.ts
id string types.ts
label string types.ts
nonOptionalErrorMsg? string types.ts
placeholder? string types.ts

FullPageAuthComponent<PreloadInfoType>

type FullPageAuthComponent<PreloadInfoType> = object;

Defined in: types.ts

Type Parameters

Type Parameter Default type
PreloadInfoType any

Properties

Property Type Defined in
component React.FC<FullPageAuthComponentProps<PreloadInfoType>> types.ts
preloadInfoAndRunChecks (firstFactors, userContext, isSignUp) => Promise< | { preloadInfo: PreloadInfoType; shouldDisplay: true; } | { shouldDisplay: false; }> types.ts
type "FULL_PAGE" types.ts

FullPageAuthComponentProps<PreloadInfoType>

type FullPageAuthComponentProps<PreloadInfoType> = AuthComponentProps & object;

Defined in: types.ts

Type Declaration

Name Type Defined in
preloadInfo PreloadInfoType types.ts

Type Parameters

Type Parameter
PreloadInfoType

GetRedirectionURLContext

type GetRedirectionURLContext = NormalisedGetRedirectionURLContext<
  | {
  action: "TO_AUTH";
  showSignIn?: boolean;
}
| SuccessRedirectContextInApp>;

Defined in: types.ts


type Navigate = 
  | {
  goBack: () => void;
  push: (path) => void;
}
  | NavigateFunction;

Defined in: types.ts


NonPublicConfigPropertiesType

type NonPublicConfigPropertiesType = typeof nonPublicConfigProperties[number];

Defined in: types.ts


NormalisedAppInfo

type NormalisedAppInfo = object;

Defined in: types.ts

Properties

Property Type Defined in
apiBasePath SuperTokensWrapper types.ts
apiDomain SuperTokensWrapper types.ts
appName string types.ts
websiteBasePath SuperTokensWrapper types.ts
websiteDomain SuperTokensWrapper types.ts

NormalisedBaseConfig

type NormalisedBaseConfig = object;

Defined in: types.ts

Properties

Property Type Defined in
style string types.ts

NormalisedConfigWithAppInfoAndRecipeID<NormalisedConfig>

type NormalisedConfigWithAppInfoAndRecipeID<NormalisedConfig> = NormalisedConfig & object;

Defined in: types.ts

Type Declaration

Name Type Defined in
appInfo NormalisedAppInfo types.ts
recipeId string types.ts

Type Parameters

Type Parameter
NormalisedConfig

NormalisedFormField

type NormalisedFormField = object;

Defined in: types.ts

Properties

Property Type Defined in
autoComplete? string types.ts
autofocus? boolean types.ts
getDefaultValue? () => string types.ts
hidden? boolean types.ts
id string types.ts
label string types.ts
nonOptionalErrorMsg? string types.ts
optional boolean types.ts
placeholder string types.ts
validate (value) => Promise<string | undefined> | string | undefined types.ts

NormalisedGetRedirectionURLContext<RecipeContext>

type NormalisedGetRedirectionURLContext<RecipeContext> = RecipeContext & object;

Defined in: types.ts

Type Declaration

Name Type Defined in
tenantIdFromQueryParams string | undefined types.ts

Type Parameters

Type Parameter
RecipeContext

PartialAuthComponent

type PartialAuthComponent = object;

Defined in: types.ts

Properties

Property Type Defined in
component React.FC<PartialAuthComponentProps> types.ts
displayOrder number types.ts
factorIds string[] types.ts
type "SIGN_IN_UP" | "SIGN_IN" | "SIGN_UP" types.ts

PartialAuthComponentProps

type PartialAuthComponentProps = AuthComponentProps;

Defined in: types.ts


PluginRouteHandler

type PluginRouteHandler = object;

Defined in: types.ts

Properties

Property Type Defined in
handler () => JSX.Element types.ts
path string types.ts

ReactComponentClass<P>

type ReactComponentClass<P> = ComponentClass<P, any> | (props) => JSX.Element;

Defined in: types.ts

Type Parameters

Type Parameter Default type
P any

RecipeFeatureComponentMap

type RecipeFeatureComponentMap = Record<string, ComponentWithRecipeAndMatchingMethod>;

Defined in: types.ts


RecipeInitResult<T, Action, R, P>

type RecipeInitResult<T, Action, R, P> = object;

Defined in: types.ts

Type Parameters

Type Parameter
T
Action
R
P extends NormalisedRecipeModuleConfig<T, Action, R>

Properties

Property Type Defined in
authReact CreateRecipeFunction<T, Action, R, P> types.ts
recipeID string types.ts
webJS SuperTokensWrapper<Action> types.ts

RecipePluginOverride<T>

type RecipePluginOverride<T> = object;

Defined in: types.ts

Type Parameters

Type Parameter
T extends keyof AllRecipeConfigs

Properties

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

SessionClaimValidator

type SessionClaimValidator = SuperTokensWrapper & object;

Defined in: types.ts

Type Declaration

Name Type Defined in
onFailureRedirection? ValidationFailureCallback types.ts
showAccessDeniedOnFailure? boolean types.ts

SuccessRedirectContext

type SuccessRedirectContext = 
  | SuccessRedirectContextInApp
  | SuccessRedirectContextOAuth2;

Defined in: types.ts


SuccessRedirectContextInApp

type SuccessRedirectContextInApp = SuccessRedirectContextCommon & object;

Defined in: types.ts

Type Declaration

Name Type Defined in
action "SUCCESS" types.ts
redirectToPath? string types.ts

SuccessRedirectContextOAuth2

type SuccessRedirectContextOAuth2 = SuccessRedirectContextCommon & object;

Defined in: types.ts

Type Declaration

Name Type Defined in
action "SUCCESS_OAUTH2" types.ts
frontendRedirectTo string types.ts

SuperTokensConfig

type SuperTokensConfig = object;

Defined in: types.ts

Properties

Property Type Description Defined in
appInfo AppInfoUserInput - types.ts
clientType? string Identifier for the client, such as web, ios, etc. to be used with thirdparty, multitenancy recipes. types.ts
cookieHandler? SuperTokensWrapper - types.ts
dateProvider? SuperTokensWrapper - types.ts
defaultToSignUp? boolean - types.ts
disableAuthRoute? boolean - types.ts
enableDebugLogs? 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
getRedirectionURL? (context, userContext) => Promise<string | undefined | null> - types.ts
languageTranslations? object - types.ts
languageTranslations.currentLanguageCookieScope? string - types.ts
languageTranslations.defaultLanguage? string - types.ts
languageTranslations.translationFunc? TranslationFunc - types.ts
languageTranslations.translations? TranslationStore - types.ts
privacyPolicyLink? string - types.ts
recipeList object[] - types.ts
style? string - types.ts
termsOfServiceLink? string - types.ts
usesDynamicLoginMethods? boolean - types.ts
useShadowDom? boolean - types.ts
windowHandler? SuperTokensWrapper - types.ts

SuperTokensConfigWithNormalisedAppInfo

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

Defined in: types.ts

Type Declaration

Name Type Defined in
appInfo NormalisedAppInfo types.ts

SuperTokensPlugin

type SuperTokensPlugin = object;

Defined in: types.ts

Properties

Property Type Defined in
compatibleAuthReactSDKVersions? string | string[] types.ts
compatibleWebJSSDKVersions? 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
generalAuthRecipeComponentOverrides? AuthRecipeComponentOverrideMap 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<SuperTokensConfig, NonPublicConfigPropertiesType>, "appInfo"> & object;

Defined in: types.ts

Type Declaration

Name Type Defined in
appInfo NormalisedAppInfo types.ts

SuperTokensPublicPlugin

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

Defined in: types.ts

Type Declaration

Name Type Defined in
initialized boolean types.ts

ThemeBaseProps

type ThemeBaseProps = object;

Defined in: types.ts

Properties

Property Type Defined in
styleFromInit? string types.ts

UserContext

type UserContext = Record<string, any>;

Defined in: types.ts


ValidationFailureCallback

type ValidationFailureCallback = 
  | ({
          userContext,
          reason,
      }) => Promise<string | undefined> | string | undefined
  | undefined;

Defined in: types.ts


WebJSRecipeInterface<T>

type WebJSRecipeInterface<T> = Omit<T, "default" | "init" | "signOut">;

Defined in: types.ts

Type Parameters

Type Parameter
T

Variables

nonPublicConfigProperties

const nonPublicConfigProperties: readonly ["experimental"];

Defined in: types.ts

API reference

API schema and response details