Options
All
  • Public
  • Public/Protected
  • All
Menu

These are the SDK reference docs. If you’re looking for docs to implement SuperTokens, you might want to check out the User Guides

Index

Type aliases

ClaimValidationError

ClaimValidationError: { reason?: any; validatorId: string }

Type declaration

  • Optional reason?: any
  • validatorId: string

ClaimValidationResult

ClaimValidationResult: { isValid: true } | { isValid: false; reason?: any }

RecipeInterface

RecipeInterface: { addAxiosInterceptors: any; addFetchInterceptorsAndReturnModifiedFetch: any; doesSessionExist: any; getAccessTokenPayloadSecurely: any; getGlobalClaimValidators: any; getInvalidClaimsFromResponse: any; getUserId: any; signOut: any; validateClaims: any }

Type declaration

  • addAxiosInterceptors:function
    • addAxiosInterceptors(input: { axiosInstance: any; userContext: any }): void
    • Parameters

      • input: { axiosInstance: any; userContext: any }
        • axiosInstance: any
        • userContext: any

      Returns void

  • addFetchInterceptorsAndReturnModifiedFetch:function
    • addFetchInterceptorsAndReturnModifiedFetch(input: { originalFetch: any; userContext: any }): (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>
    • Parameters

      • input: { originalFetch: any; userContext: any }
        • originalFetch: any
        • userContext: any

      Returns (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>

        • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
        • Parameters

          • input: URL | RequestInfo
          • Optional init: RequestInit

          Returns Promise<Response>

  • doesSessionExist:function
    • doesSessionExist(input: { userContext: any }): Promise<boolean>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<boolean>

  • getAccessTokenPayloadSecurely:function
    • getAccessTokenPayloadSecurely(input: { userContext: any }): Promise<any>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<any>

  • getGlobalClaimValidators:function
  • getInvalidClaimsFromResponse:function
    • getInvalidClaimsFromResponse(input: { response: { data: any } | Response; userContext: any }): Promise<ClaimValidationError[]>
    • Parameters

      • input: { response: { data: any } | Response; userContext: any }
        • response: { data: any } | Response
        • userContext: any

      Returns Promise<ClaimValidationError[]>

  • getUserId:function
    • getUserId(input: { userContext: any }): Promise<string>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<string>

  • signOut:function
    • signOut(input: { userContext: any }): Promise<void>
    • Parameters

      • input: { userContext: any }
        • userContext: any

      Returns Promise<void>

  • validateClaims:function

SessionClaim

SessionClaim<ValueType>: { getLastFetchedTime: any; getValueFromPayload: any; refresh: any }

Type parameters

  • ValueType

Type declaration

  • getLastFetchedTime:function
    • getLastFetchedTime(payload: any, _userContext?: any): undefined | number
    • Parameters

      • payload: any
      • Optional _userContext: any

      Returns undefined | number

  • getValueFromPayload:function
    • getValueFromPayload(payload: any, _userContext?: any): undefined | ValueType
    • Parameters

      • payload: any
      • Optional _userContext: any

      Returns undefined | ValueType

  • refresh:function
    • refresh(userContext: any): Promise<void>
    • Parameters

      • userContext: any

      Returns Promise<void>

UserInput

UserInput: Omit<WebsiteInputType, "apiDomain" | "apiBasePath" | "enableDebugLogs" | "cookieHandler" | "windowHandler">

Functions

Const addAxiosInterceptors

  • addAxiosInterceptors(axiosInstance: any, userContext?: any): void

Const attemptRefreshingSession

  • attemptRefreshingSession(): Promise<boolean>

Const doesSessionExist

  • doesSessionExist(input?: { userContext?: any }): Promise<boolean>

Const getAccessTokenPayloadSecurely

  • getAccessTokenPayloadSecurely(input?: { userContext?: any }): Promise<any>

Const getClaimValue

  • getClaimValue<T>(input: { claim: SessionClaim<T>; userContext?: any }): Promise<undefined | T>

Const getInvalidClaimsFromResponse

  • getInvalidClaimsFromResponse(input: { response: Response | { data: any }; userContext?: any }): Promise<ClaimValidationError[]>

Const getUserId

  • getUserId(input?: { userContext?: any }): Promise<string>

Const init

  • init(config?: UserInput): CreateRecipeFunction<unknown>

Const signOut

  • signOut(input?: { userContext?: any }): Promise<void>

Const validateClaims

Generated using TypeDoc