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

Module recipe/session

Index

Type aliases

APIInterface

APIInterface: { refreshPOST: undefined | ((input: { options: APIOptions }) => Promise<void>); signOutPOST: undefined | ((input: { options: APIOptions }) => Promise<{ status: "OK" }>); verifySession: any }

Type declaration

APIOptions

APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

RecipeInterface

RecipeInterface: { createNewSession: any; getAccessTokenLifeTimeMS: any; getAllSessionHandlesForUser: any; getRefreshTokenLifeTimeMS: any; getSession: any; getSessionInformation: any; refreshSession: any; revokeAllSessionsForUser: any; revokeMultipleSessions: any; revokeSession: any; updateAccessTokenPayload: any; updateSessionData: any }

Type declaration

  • createNewSession:function
    • createNewSession(input: { accessTokenPayload?: any; res: any; sessionData?: any; userId: string }): Promise<SessionContainer>
  • getAccessTokenLifeTimeMS:function
    • getAccessTokenLifeTimeMS(): Promise<number>
  • getAllSessionHandlesForUser:function
    • getAllSessionHandlesForUser(input: { userId: string }): Promise<string[]>
  • getRefreshTokenLifeTimeMS:function
    • getRefreshTokenLifeTimeMS(): Promise<number>
  • getSession:function
  • getSessionInformation:function
    • Used to retrieve all session information for a given session handle. Can be used in place of:

      • getSessionData
      • getAccessTokenPayload

      Parameters

      • input: { sessionHandle: string }
        • sessionHandle: string

      Returns Promise<SessionInformation>

  • refreshSession:function
  • revokeAllSessionsForUser:function
    • revokeAllSessionsForUser(input: { userId: string }): Promise<string[]>
  • revokeMultipleSessions:function
    • revokeMultipleSessions(input: { sessionHandles: string[] }): Promise<string[]>
  • revokeSession:function
    • revokeSession(input: { sessionHandle: string }): Promise<boolean>
  • updateAccessTokenPayload:function
    • updateAccessTokenPayload(input: { newAccessTokenPayload: any; sessionHandle: string }): Promise<void>
    • Parameters

      • input: { newAccessTokenPayload: any; sessionHandle: string }
        • newAccessTokenPayload: any
        • sessionHandle: string

      Returns Promise<void>

  • updateSessionData:function
    • updateSessionData(input: { newSessionData: any; sessionHandle: string }): Promise<void>

SessionInformation

SessionInformation: { accessTokenPayload: any; expiry: number; sessionData: any; sessionHandle: string; timeCreated: number; userId: string }

Type declaration

  • accessTokenPayload: any
  • expiry: number
  • sessionData: any
  • sessionHandle: string
  • timeCreated: number
  • userId: string

Variables

Error

Error: typeof default = ...

Functions

createNewSession

  • createNewSession(res: any, userId: string, accessTokenPayload?: any, sessionData?: any): Promise<SessionContainer>

getAllSessionHandlesForUser

  • getAllSessionHandlesForUser(userId: string): Promise<string[]>

getSession

getSessionInformation

init

  • init(config?: TypeInput): RecipeListFunction

refreshSession

revokeAllSessionsForUser

  • revokeAllSessionsForUser(userId: string): Promise<string[]>

revokeMultipleSessions

  • revokeMultipleSessions(sessionHandles: string[]): Promise<string[]>

revokeSession

  • revokeSession(sessionHandle: string): Promise<boolean>

updateAccessTokenPayload

  • updateAccessTokenPayload(sessionHandle: string, newAccessTokenPayload: any): Promise<void>

updateSessionData

  • updateSessionData(sessionHandle: string, newSessionData: any): Promise<void>

Generated using TypeDoc