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

APIInterface

APIInterface: { getJWKSGET: undefined | ((input: { options: APIOptions }) => Promise<{ keys: JsonWebKey[]; status: "OK" }>) }

Type declaration

  • getJWKSGET: undefined | ((input: { options: APIOptions }) => Promise<{ keys: JsonWebKey[]; status: "OK" }>)

APIOptions

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

Type declaration

JsonWebKey

JsonWebKey: { alg: string; e: string; kid: string; kty: string; n: string; use: string }

Type declaration

  • alg: string
  • e: string
  • kid: string
  • kty: string
  • n: string
  • use: string

RecipeInterface

RecipeInterface: { createJWT: any; getJWKS: any }

Type declaration

  • createJWT:function
    • createJWT(input: { payload?: any; validitySeconds?: number }): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • input: { payload?: any; validitySeconds?: number }
        • Optional payload?: any
        • Optional validitySeconds?: number

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • getJWKS:function
    • getJWKS(): Promise<{ keys: JsonWebKey[]; status: "OK" }>

Functions

createJWT

  • createJWT(payload: any, validitySeconds?: number): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • payload: any
    • Optional validitySeconds: number

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

getJWKS

  • getJWKS(): Promise<{ keys: JsonWebKey[]; status: "OK" }>

init

  • init(config?: TypeInput): RecipeListFunction

Generated using TypeDoc