diff --git a/docs/classes/framework.BaseRequest.html b/docs/classes/framework.BaseRequest.html index 41fcfd618..b267919aa 100644 --- a/docs/classes/framework.BaseRequest.html +++ b/docs/classes/framework.BaseRequest.html @@ -1 +1 @@ -BaseRequest | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BaseRequest

Index

Constructors

Properties

getCookieValue: (key_: string) => undefined | string

Type declaration

    • (key_: string): undefined | string
    • Parameters

      • key_: string

      Returns undefined | string

getFormData: () => Promise<any>

Type declaration

    • (): Promise<any>
    • Returns Promise<any>

getHeaderValue: (key: string) => undefined | string

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getJSONBody: () => Promise<any>

Type declaration

    • (): Promise<any>
    • Returns Promise<any>

getKeyValueFromQuery: (key: string) => undefined | string

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getMethod: () => HTTPMethod

Type declaration

    • (): HTTPMethod
    • Returns HTTPMethod

getOriginalURL: () => string

Type declaration

    • (): string
    • Returns string

original: any
wrapperUsed: boolean

Generated using TypeDoc

\ No newline at end of file +BaseRequest | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BaseRequest

Index

Constructors

Properties

getCookieValue: (key_: string) => undefined | string

Type declaration

    • (key_: string): undefined | string
    • Parameters

      • key_: string

      Returns undefined | string

getFormData: () => Promise<any>

Type declaration

    • (): Promise<any>
    • Returns Promise<any>

getHeaderValue: (key: string) => undefined | string

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getJSONBody: () => Promise<any>

Type declaration

    • (): Promise<any>
    • Returns Promise<any>

getKeyValueFromQuery: (key: string) => undefined | string

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getMethod: () => HTTPMethod

Type declaration

    • (): HTTPMethod
    • Returns HTTPMethod

getOriginalURL: () => string

Type declaration

    • (): string
    • Returns string

original: any
wrapperUsed: boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/framework.BaseResponse.html b/docs/classes/framework.BaseResponse.html index cf333f969..a9b64eead 100644 --- a/docs/classes/framework.BaseResponse.html +++ b/docs/classes/framework.BaseResponse.html @@ -1 +1 @@ -BaseResponse | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BaseResponse

Index

Constructors

Properties

original: any
removeHeader: (key: string) => void

Type declaration

    • (key: string): void
    • Parameters

      • key: string

      Returns void

sendHTMLResponse: (html: string) => void

Type declaration

    • (html: string): void
    • Parameters

      • html: string

      Returns void

sendJSONResponse: (content: any) => void

Type declaration

    • (content: any): void
    • Parameters

      • content: any

      Returns void

setCookie: (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none") => void

Type declaration

    • (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
    • Parameters

      • key: string
      • value: string
      • domain: undefined | string
      • secure: boolean
      • httpOnly: boolean
      • expires: number
      • path: string
      • sameSite: "strict" | "lax" | "none"

      Returns void

setHeader: (key: string, value: string, allowDuplicateKey: boolean) => void

Type declaration

    • (key: string, value: string, allowDuplicateKey: boolean): void
    • Parameters

      • key: string
      • value: string
      • allowDuplicateKey: boolean

      Returns void

setStatusCode: (statusCode: number) => void

Type declaration

    • (statusCode: number): void
    • Parameters

      • statusCode: number

      Returns void

wrapperUsed: boolean

Generated using TypeDoc

\ No newline at end of file +BaseResponse | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BaseResponse

Index

Constructors

Properties

original: any
removeHeader: (key: string) => void

Type declaration

    • (key: string): void
    • Parameters

      • key: string

      Returns void

sendHTMLResponse: (html: string) => void

Type declaration

    • (html: string): void
    • Parameters

      • html: string

      Returns void

sendJSONResponse: (content: any) => void

Type declaration

    • (content: any): void
    • Parameters

      • content: any

      Returns void

setCookie: (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none") => void

Type declaration

    • (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
    • Parameters

      • key: string
      • value: string
      • domain: undefined | string
      • secure: boolean
      • httpOnly: boolean
      • expires: number
      • path: string
      • sameSite: "strict" | "lax" | "none"

      Returns void

setHeader: (key: string, value: string, allowDuplicateKey: boolean) => void

Type declaration

    • (key: string, value: string, allowDuplicateKey: boolean): void
    • Parameters

      • key: string
      • value: string
      • allowDuplicateKey: boolean

      Returns void

setStatusCode: (statusCode: number) => void

Type declaration

    • (statusCode: number): void
    • Parameters

      • statusCode: number

      Returns void

wrapperUsed: boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/index.default.html b/docs/classes/index.default.html index 5bb7ae977..75ab8586e 100644 --- a/docs/classes/index.default.html +++ b/docs/classes/index.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config: TypeInput) => void = SuperTokens.init

Type declaration

    • (config: TypeInput): void
    • Parameters

      • config: TypeInput

      Returns void

Methods

  • createUserIdMapping(input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }): Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
  • Parameters

    • input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }
      • externalUserId: string
      • Optional externalUserIdInfo?: string
      • Optional force?: boolean
      • superTokensUserId: string

    Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>

  • deleteUser(userId: string): Promise<{ status: "OK" }>
  • deleteUserIdMapping(input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ didMappingExist: boolean; status: "OK" }>
  • Parameters

    • input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • Optional force?: boolean
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ didMappingExist: boolean; status: "OK" }>

  • getAllCORSHeaders(): string[]
  • getUserCount(includeRecipeIds?: string[]): Promise<number>
  • Parameters

    • Optional includeRecipeIds: string[]

    Returns Promise<number>

  • getUserIdMapping(input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
  • Parameters

    • input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>

  • getUsersNewestFirst(input?: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }): Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
  • Parameters

    • Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
      • Optional includeRecipeIds?: string[]
      • Optional limit?: number
      • Optional paginationToken?: string

    Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>

  • getUsersOldestFirst(input?: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }): Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
  • Parameters

    • Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
      • Optional includeRecipeIds?: string[]
      • Optional limit?: number
      • Optional paginationToken?: string

    Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>

  • updateOrDeleteUserIdMappingInfo(input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
  • Parameters

    • input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • Optional externalUserIdInfo?: string
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config: TypeInput) => void = SuperTokens.init

Type declaration

    • (config: TypeInput): void
    • Parameters

      • config: TypeInput

      Returns void

Methods

  • createUserIdMapping(input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }): Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
  • Parameters

    • input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }
      • externalUserId: string
      • Optional externalUserIdInfo?: string
      • Optional force?: boolean
      • superTokensUserId: string

    Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>

  • deleteUser(userId: string): Promise<{ status: "OK" }>
  • deleteUserIdMapping(input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ didMappingExist: boolean; status: "OK" }>
  • Parameters

    • input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • Optional force?: boolean
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ didMappingExist: boolean; status: "OK" }>

  • getAllCORSHeaders(): string[]
  • getUserCount(includeRecipeIds?: string[]): Promise<number>
  • Parameters

    • Optional includeRecipeIds: string[]

    Returns Promise<number>

  • getUserIdMapping(input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
  • Parameters

    • input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>

  • getUsersNewestFirst(input?: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }): Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
  • Parameters

    • Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
      • Optional includeRecipeIds?: string[]
      • Optional limit?: number
      • Optional paginationToken?: string

    Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>

  • getUsersOldestFirst(input?: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }): Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
  • Parameters

    • Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
      • Optional includeRecipeIds?: string[]
      • Optional limit?: number
      • Optional paginationToken?: string

    Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>

  • updateOrDeleteUserIdMappingInfo(input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
  • Parameters

    • input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • Optional externalUserIdInfo?: string
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/ingredients_emaildelivery.default.html b/docs/classes/ingredients_emaildelivery.default.html index 8fc8e5edb..b73725646 100644 --- a/docs/classes/ingredients_emaildelivery.default.html +++ b/docs/classes/ingredients_emaildelivery.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

  • default

Index

Constructors

  • new default<T>(config: TypeInputWithService<T>): default<T>

Properties

ingredientInterfaceImpl: EmailDeliveryInterface<T>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

  • default

Index

Constructors

  • new default<T>(config: TypeInputWithService<T>): default<T>

Properties

ingredientInterfaceImpl: EmailDeliveryInterface<T>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/ingredients_smsdelivery.default.html b/docs/classes/ingredients_smsdelivery.default.html index ce61b9240..d7fec8880 100644 --- a/docs/classes/ingredients_smsdelivery.default.html +++ b/docs/classes/ingredients_smsdelivery.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

  • default

Index

Constructors

  • new default<T>(config: TypeInputWithService<T>): default<T>

Properties

ingredientInterfaceImpl: SmsDeliveryInterface<T>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

  • default

Index

Constructors

  • new default<T>(config: TypeInputWithService<T>): default<T>

Properties

ingredientInterfaceImpl: SmsDeliveryInterface<T>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_dashboard.default.html b/docs/classes/recipe_dashboard.default.html index 4a51725fb..292786405 100644 --- a/docs/classes/recipe_dashboard.default.html +++ b/docs/classes/recipe_dashboard.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_emailpassword.default.html b/docs/classes/recipe_emailpassword.default.html index 709f3bba1..1d7d1e195 100644 --- a/docs/classes/recipe_emailpassword.default.html +++ b/docs/classes/recipe_emailpassword.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createResetPasswordToken(userId: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
  • getUserByEmail(email: string, userContext?: any): Promise<undefined | User>
  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • resetPasswordUsingToken(token: string, newPassword: string, userContext?: any): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
  • Parameters

    • token: string
    • newPassword: string
    • Optional userContext: any

    Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

  • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
  • signIn(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
  • signUp(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
  • updateEmailOrPassword(input: { email?: string; password?: string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
  • Parameters

    • input: { email?: string; password?: string; userContext?: any; userId: string }
      • Optional email?: string
      • Optional password?: string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createResetPasswordToken(userId: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
  • getUserByEmail(email: string, userContext?: any): Promise<undefined | User>
  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • resetPasswordUsingToken(token: string, newPassword: string, userContext?: any): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
  • Parameters

    • token: string
    • newPassword: string
    • Optional userContext: any

    Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

  • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
  • signIn(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
  • signUp(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
  • updateEmailOrPassword(input: { email?: string; password?: string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
  • Parameters

    • input: { email?: string; password?: string; userContext?: any; userId: string }
      • Optional email?: string
      • Optional password?: string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_emailverification.default.html b/docs/classes/recipe_emailverification.default.html index 6fbcd5ddf..c8e9e9aba 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationClaim
Error: typeof default = SuperTokensError
init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • createEmailVerificationToken(userId: string, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

    • userId: string
    • Optional email: string
    • Optional userContext: any

    Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>

  • isEmailVerified(userId: string, email?: string, userContext?: any): Promise<boolean>
  • revokeEmailVerificationTokens(userId: string, email?: string, userContext?: any): Promise<{ status: string }>
  • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
  • unverifyEmail(userId: string, email?: string, userContext?: any): Promise<{ status: string }>
  • verifyEmailUsingToken(token: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationClaim
Error: typeof default = SuperTokensError
init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • createEmailVerificationToken(userId: string, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • Parameters

    • userId: string
    • Optional email: string
    • Optional userContext: any

    Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>

  • isEmailVerified(userId: string, email?: string, userContext?: any): Promise<boolean>
  • revokeEmailVerificationTokens(userId: string, email?: string, userContext?: any): Promise<{ status: string }>
  • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
  • unverifyEmail(userId: string, email?: string, userContext?: any): Promise<{ status: string }>
  • verifyEmailUsingToken(token: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_jwt.default.html b/docs/classes/recipe_jwt.default.html index 70fb5a8b5..66109b04f 100644 --- a/docs/classes/recipe_jwt.default.html +++ b/docs/classes/recipe_jwt.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Methods

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

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

    • payload: any
    • Optional validitySeconds: number
    • Optional userContext: any

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

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

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Methods

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

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

    • payload: any
    • Optional validitySeconds: number
    • Optional userContext: any

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

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

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_openid.default.html b/docs/classes/recipe_openid.default.html index 8a4117573..320498aa9 100644 --- a/docs/classes/recipe_openid.default.html +++ b/docs/classes/recipe_openid.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = OpenIdRecipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

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

    • Optional payload: any
    • Optional validitySeconds: number
    • Optional userContext: any

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

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; status: "OK" }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = OpenIdRecipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

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

    • Optional payload: any
    • Optional validitySeconds: number
    • Optional userContext: any

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

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; status: "OK" }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index 0849f967a..4faeab4f1 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
  • Parameters

    • input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }

    Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode(input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
  • Parameters

    • input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createMagicLink(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<string>
  • createNewCodeForDevice(input: { deviceId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
  • Parameters

    • input: { deviceId: string; userContext?: any; userInputCode?: string }
      • deviceId: string
      • Optional userContext?: any
      • Optional userInputCode?: string

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • getUserByEmail(input: { email: string; userContext?: any }): Promise<undefined | User>
  • getUserById(input: { userContext?: any; userId: string }): Promise<undefined | User>
  • getUserByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<undefined | User>
  • listCodesByDeviceId(input: { deviceId: string; userContext?: any }): Promise<undefined | DeviceType>
  • listCodesByEmail(input: { email: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { preAuthSessionId: string; userContext?: any }
      • preAuthSessionId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • revokeAllCodes(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ status: "OK" }>
  • revokeCode(input: { codeId: string; userContext?: any }): Promise<{ status: "OK" }>
  • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
  • signInUp(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: string; user: User }>
  • Parameters

    • input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }

    Returns Promise<{ createdNewUser: boolean; status: string; user: User }>

  • updateUser(input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
  • Parameters

    • input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
      • Optional email?: null | string
      • Optional phoneNumber?: null | string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
  • Parameters

    • input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }

    Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode(input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
  • Parameters

    • input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createMagicLink(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<string>
  • createNewCodeForDevice(input: { deviceId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
  • Parameters

    • input: { deviceId: string; userContext?: any; userInputCode?: string }
      • deviceId: string
      • Optional userContext?: any
      • Optional userInputCode?: string

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • getUserByEmail(input: { email: string; userContext?: any }): Promise<undefined | User>
  • getUserById(input: { userContext?: any; userId: string }): Promise<undefined | User>
  • getUserByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<undefined | User>
  • listCodesByDeviceId(input: { deviceId: string; userContext?: any }): Promise<undefined | DeviceType>
  • listCodesByEmail(input: { email: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { preAuthSessionId: string; userContext?: any }
      • preAuthSessionId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • revokeAllCodes(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ status: "OK" }>
  • revokeCode(input: { codeId: string; userContext?: any }): Promise<{ status: "OK" }>
  • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
  • signInUp(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: string; user: User }>
  • Parameters

    • input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }

    Returns Promise<{ createdNewUser: boolean; status: string; user: User }>

  • updateUser(input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
  • Parameters

    • input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
      • Optional email?: null | string
      • Optional phoneNumber?: null | string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_session.default.html b/docs/classes/recipe_session.default.html index b992ca0d8..b29df770c 100644 --- a/docs/classes/recipe_session.default.html +++ b/docs/classes/recipe_session.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

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

    • Optional payload: any
    • Optional validitySeconds: number
    • userContext: any = {}

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

  • createNewSession(req: any, res: any, userId: string, accessTokenPayload?: any, sessionData?: any, userContext?: any): Promise<SessionContainer>
  • fetchAndSetClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
  • getAllSessionHandlesForUser(userId: string, userContext?: any): Promise<string[]>
  • getClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, userContext?: any): Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
  • Type parameters

    • T

    Parameters

    • sessionHandle: string
    • claim: SessionClaim<T>
    • userContext: any = {}

    Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; status: "OK" }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
  • getSessionInformation(sessionHandle: string, userContext?: any): Promise<undefined | SessionInformation>
  • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
  • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
  • regenerateAccessToken(accessToken: string, newAccessTokenPayload?: any, userContext?: any): Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; userDataInJWT: any; userId: string }; status: "OK" }>
  • Parameters

    • accessToken: string
    • Optional newAccessTokenPayload: any
    • userContext: any = {}

    Returns Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; userDataInJWT: any; userId: string }; status: "OK" }>

  • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
  • revokeAllSessionsForUser(userId: string, userContext?: any): Promise<string[]>
  • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
  • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
  • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
  • updateAccessTokenPayload(sessionHandle: string, newAccessTokenPayload: any, userContext?: any): Promise<boolean>
  • updateSessionData(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

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

    • Optional payload: any
    • Optional validitySeconds: number
    • userContext: any = {}

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

  • createNewSession(req: any, res: any, userId: string, accessTokenPayload?: any, sessionData?: any, userContext?: any): Promise<SessionContainer>
  • fetchAndSetClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
  • getAllSessionHandlesForUser(userId: string, userContext?: any): Promise<string[]>
  • getClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, userContext?: any): Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
  • Type parameters

    • T

    Parameters

    • sessionHandle: string
    • claim: SessionClaim<T>
    • userContext: any = {}

    Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; status: "OK" }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
  • getSessionInformation(sessionHandle: string, userContext?: any): Promise<undefined | SessionInformation>
  • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
  • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
  • regenerateAccessToken(accessToken: string, newAccessTokenPayload?: any, userContext?: any): Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; userDataInJWT: any; userId: string }; status: "OK" }>
  • Parameters

    • accessToken: string
    • Optional newAccessTokenPayload: any
    • userContext: any = {}

    Returns Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; userDataInJWT: any; userId: string }; status: "OK" }>

  • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
  • revokeAllSessionsForUser(userId: string, userContext?: any): Promise<string[]>
  • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
  • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
  • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
  • updateAccessTokenPayload(sessionHandle: string, newAccessTokenPayload: any, userContext?: any): Promise<boolean>
  • updateSessionData(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_thirdparty.default.html b/docs/classes/recipe_thirdparty.default.html index aed7f47ca..32555076c 100644 --- a/docs/classes/recipe_thirdparty.default.html +++ b/docs/classes/recipe_thirdparty.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Apple: (config: TypeThirdPartyProviderAppleConfig) => TypeProvider = thirdPartyProviders.Apple

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderAppleConfig

      Returns TypeProvider

Discord: (config: TypeThirdPartyProviderDiscordConfig) => TypeProvider = thirdPartyProviders.Discord

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderDiscordConfig

      Returns TypeProvider

Error: typeof default = SuperTokensError
Facebook: (config: TypeThirdPartyProviderFacebookConfig) => TypeProvider = thirdPartyProviders.Facebook

Type declaration

    • (config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderFacebookConfig

      Returns TypeProvider

Github: (config: TypeThirdPartyProviderGithubConfig) => TypeProvider = thirdPartyProviders.Github

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGithubConfig

      Returns TypeProvider

Google: (config: TypeThirdPartyProviderGoogleConfig) => TypeProvider = thirdPartyProviders.Google

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGoogleConfig

      Returns TypeProvider

GoogleWorkspaces: (config: TypeThirdPartyProviderGoogleWorkspacesConfig) => TypeProvider = thirdPartyProviders.GoogleWorkspaces

Type declaration

    • (config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderGoogleWorkspacesConfig

      Returns TypeProvider

init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
  • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
  • signInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
  • Parameters

    • thirdPartyId: string
    • thirdPartyUserId: string
    • email: string
    • userContext: any = {}

    Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Apple: (config: TypeThirdPartyProviderAppleConfig) => TypeProvider = thirdPartyProviders.Apple

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderAppleConfig

      Returns TypeProvider

Discord: (config: TypeThirdPartyProviderDiscordConfig) => TypeProvider = thirdPartyProviders.Discord

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderDiscordConfig

      Returns TypeProvider

Error: typeof default = SuperTokensError
Facebook: (config: TypeThirdPartyProviderFacebookConfig) => TypeProvider = thirdPartyProviders.Facebook

Type declaration

    • (config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderFacebookConfig

      Returns TypeProvider

Github: (config: TypeThirdPartyProviderGithubConfig) => TypeProvider = thirdPartyProviders.Github

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGithubConfig

      Returns TypeProvider

Google: (config: TypeThirdPartyProviderGoogleConfig) => TypeProvider = thirdPartyProviders.Google

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGoogleConfig

      Returns TypeProvider

GoogleWorkspaces: (config: TypeThirdPartyProviderGoogleWorkspacesConfig) => TypeProvider = thirdPartyProviders.GoogleWorkspaces

Type declaration

    • (config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderGoogleWorkspacesConfig

      Returns TypeProvider

init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
  • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
  • signInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
  • Parameters

    • thirdPartyId: string
    • thirdPartyUserId: string
    • email: string
    • userContext: any = {}

    Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_thirdpartyemailpassword.default.html b/docs/classes/recipe_thirdpartyemailpassword.default.html index a19eaf34f..2b44694b0 100644 --- a/docs/classes/recipe_thirdpartyemailpassword.default.html +++ b/docs/classes/recipe_thirdpartyemailpassword.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Apple: (config: TypeThirdPartyProviderAppleConfig) => TypeProvider = thirdPartyProviders.Apple

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderAppleConfig

      Returns TypeProvider

Discord: (config: TypeThirdPartyProviderDiscordConfig) => TypeProvider = thirdPartyProviders.Discord

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderDiscordConfig

      Returns TypeProvider

Error: typeof default = SuperTokensError
Facebook: (config: TypeThirdPartyProviderFacebookConfig) => TypeProvider = thirdPartyProviders.Facebook

Type declaration

    • (config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderFacebookConfig

      Returns TypeProvider

Github: (config: TypeThirdPartyProviderGithubConfig) => TypeProvider = thirdPartyProviders.Github

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGithubConfig

      Returns TypeProvider

Google: (config: TypeThirdPartyProviderGoogleConfig) => TypeProvider = thirdPartyProviders.Google

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGoogleConfig

      Returns TypeProvider

GoogleWorkspaces: (config: TypeThirdPartyProviderGoogleWorkspacesConfig) => TypeProvider = thirdPartyProviders.GoogleWorkspaces

Type declaration

    • (config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderGoogleWorkspacesConfig

      Returns TypeProvider

init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • createResetPasswordToken(userId: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
  • emailPasswordSignIn(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
  • emailPasswordSignUp(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
  • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
  • resetPasswordUsingToken(token: string, newPassword: string, userContext?: any): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
  • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
  • thirdPartySignInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
  • updateEmailOrPassword(input: { email?: string; password?: string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
  • Parameters

    • input: { email?: string; password?: string; userContext?: any; userId: string }
      • Optional email?: string
      • Optional password?: string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Apple: (config: TypeThirdPartyProviderAppleConfig) => TypeProvider = thirdPartyProviders.Apple

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderAppleConfig

      Returns TypeProvider

Discord: (config: TypeThirdPartyProviderDiscordConfig) => TypeProvider = thirdPartyProviders.Discord

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderDiscordConfig

      Returns TypeProvider

Error: typeof default = SuperTokensError
Facebook: (config: TypeThirdPartyProviderFacebookConfig) => TypeProvider = thirdPartyProviders.Facebook

Type declaration

    • (config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderFacebookConfig

      Returns TypeProvider

Github: (config: TypeThirdPartyProviderGithubConfig) => TypeProvider = thirdPartyProviders.Github

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGithubConfig

      Returns TypeProvider

Google: (config: TypeThirdPartyProviderGoogleConfig) => TypeProvider = thirdPartyProviders.Google

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGoogleConfig

      Returns TypeProvider

GoogleWorkspaces: (config: TypeThirdPartyProviderGoogleWorkspacesConfig) => TypeProvider = thirdPartyProviders.GoogleWorkspaces

Type declaration

    • (config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderGoogleWorkspacesConfig

      Returns TypeProvider

init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • createResetPasswordToken(userId: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
  • emailPasswordSignIn(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
  • emailPasswordSignUp(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
  • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
  • resetPasswordUsingToken(token: string, newPassword: string, userContext?: any): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
  • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
  • thirdPartySignInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
  • updateEmailOrPassword(input: { email?: string; password?: string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
  • Parameters

    • input: { email?: string; password?: string; userContext?: any; userId: string }
      • Optional email?: string
      • Optional password?: string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_thirdpartypasswordless.default.html b/docs/classes/recipe_thirdpartypasswordless.default.html index f2dceedcf..7a325028e 100644 --- a/docs/classes/recipe_thirdpartypasswordless.default.html +++ b/docs/classes/recipe_thirdpartypasswordless.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Apple: (config: TypeThirdPartyProviderAppleConfig) => TypeProvider = thirdPartyProviders.Apple

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderAppleConfig

      Returns TypeProvider

Discord: (config: TypeThirdPartyProviderDiscordConfig) => TypeProvider = thirdPartyProviders.Discord

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderDiscordConfig

      Returns TypeProvider

Error: typeof default = SuperTokensError
Facebook: (config: TypeThirdPartyProviderFacebookConfig) => TypeProvider = thirdPartyProviders.Facebook

Type declaration

    • (config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderFacebookConfig

      Returns TypeProvider

Github: (config: TypeThirdPartyProviderGithubConfig) => TypeProvider = thirdPartyProviders.Github

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGithubConfig

      Returns TypeProvider

Google: (config: TypeThirdPartyProviderGoogleConfig) => TypeProvider = thirdPartyProviders.Google

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGoogleConfig

      Returns TypeProvider

GoogleWorkspaces: (config: TypeThirdPartyProviderGoogleWorkspacesConfig) => TypeProvider = thirdPartyProviders.GoogleWorkspaces

Type declaration

    • (config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderGoogleWorkspacesConfig

      Returns TypeProvider

init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
  • Parameters

    • input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }

    Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode(input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
  • Parameters

    • input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createMagicLink(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<string>
  • createNewCodeForDevice(input: { deviceId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
  • Parameters

    • input: { deviceId: string; userContext?: any; userInputCode?: string }
      • deviceId: string
      • Optional userContext?: any
      • Optional userInputCode?: string

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • getUserByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<undefined | User>
  • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
  • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
  • listCodesByDeviceId(input: { deviceId: string; userContext?: any }): Promise<undefined | DeviceType>
  • listCodesByEmail(input: { email: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext?: any }): Promise<undefined | DeviceType>
  • passwordlessSignInUp(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: string; user: User }>
  • revokeAllCodes(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ status: "OK" }>
  • revokeCode(input: { codeId: string; userContext?: any }): Promise<{ status: "OK" }>
  • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
  • thirdPartySignInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
  • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
  • Parameters

    • input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
      • Optional email?: null | string
      • Optional phoneNumber?: null | string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Apple: (config: TypeThirdPartyProviderAppleConfig) => TypeProvider = thirdPartyProviders.Apple

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderAppleConfig

      Returns TypeProvider

Discord: (config: TypeThirdPartyProviderDiscordConfig) => TypeProvider = thirdPartyProviders.Discord

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderDiscordConfig

      Returns TypeProvider

Error: typeof default = SuperTokensError
Facebook: (config: TypeThirdPartyProviderFacebookConfig) => TypeProvider = thirdPartyProviders.Facebook

Type declaration

    • (config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderFacebookConfig

      Returns TypeProvider

Github: (config: TypeThirdPartyProviderGithubConfig) => TypeProvider = thirdPartyProviders.Github

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGithubConfig

      Returns TypeProvider

Google: (config: TypeThirdPartyProviderGoogleConfig) => TypeProvider = thirdPartyProviders.Google

Type declaration

    • Parameters

      • config: TypeThirdPartyProviderGoogleConfig

      Returns TypeProvider

GoogleWorkspaces: (config: TypeThirdPartyProviderGoogleWorkspacesConfig) => TypeProvider = thirdPartyProviders.GoogleWorkspaces

Type declaration

    • (config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • Parameters

      • config: TypeThirdPartyProviderGoogleWorkspacesConfig

      Returns TypeProvider

init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
  • Parameters

    • input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }

    Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode(input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
  • Parameters

    • input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createMagicLink(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<string>
  • createNewCodeForDevice(input: { deviceId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
  • Parameters

    • input: { deviceId: string; userContext?: any; userInputCode?: string }
      • deviceId: string
      • Optional userContext?: any
      • Optional userInputCode?: string

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • getUserByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<undefined | User>
  • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
  • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
  • listCodesByDeviceId(input: { deviceId: string; userContext?: any }): Promise<undefined | DeviceType>
  • listCodesByEmail(input: { email: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext?: any }): Promise<undefined | DeviceType>
  • passwordlessSignInUp(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: string; user: User }>
  • revokeAllCodes(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ status: "OK" }>
  • revokeCode(input: { codeId: string; userContext?: any }): Promise<{ status: "OK" }>
  • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
  • thirdPartySignInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
  • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
  • Parameters

    • input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
      • Optional email?: null | string
      • Optional phoneNumber?: null | string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_usermetadata.default.html b/docs/classes/recipe_usermetadata.default.html index 0893502ee..9cbf8ab57 100644 --- a/docs/classes/recipe_usermetadata.default.html +++ b/docs/classes/recipe_usermetadata.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
  • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
  • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
  • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
  • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_userroles.default.html b/docs/classes/recipe_userroles.default.html index 2658b07f0..be0d72337 100644 --- a/docs/classes/recipe_userroles.default.html +++ b/docs/classes/recipe_userroles.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

PermissionClaim: PermissionClaimClass = PermissionClaim
UserRoleClaim: UserRoleClaimClass = UserRoleClaim
init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • addRoleToUser(userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • userId: string
    • role: string
    • Optional userContext: any

    Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

  • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
  • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
  • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
  • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • role: string
    • Optional userContext: any

    Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

  • getRolesForUser(userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
  • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
  • getUsersThatHaveRole(role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • role: string
    • Optional userContext: any

    Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

  • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
  • removeUserRole(userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • userId: string
    • role: string
    • Optional userContext: any

    Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

PermissionClaim: PermissionClaimClass = PermissionClaim
UserRoleClaim: UserRoleClaimClass = UserRoleClaim
init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • addRoleToUser(userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • userId: string
    • role: string
    • Optional userContext: any

    Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

  • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
  • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
  • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
  • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • role: string
    • Optional userContext: any

    Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

  • getRolesForUser(userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
  • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
  • getUsersThatHaveRole(role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • role: string
    • Optional userContext: any

    Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

  • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
  • removeUserRole(userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
  • Parameters

    • userId: string
    • role: string
    • Optional userContext: any

    Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/framework_awsLambda.SessionEvent.html b/docs/interfaces/framework_awsLambda.SessionEvent.html index 65d38ad21..e12ac34f1 100644 --- a/docs/interfaces/framework_awsLambda.SessionEvent.html +++ b/docs/interfaces/framework_awsLambda.SessionEvent.html @@ -1 +1 @@ -SessionEvent | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SupertokensLambdaEvent
    • SessionEvent

Index

Properties

body: null | string
headers: APIGatewayProxyEventHeaders
httpMethod: string
isBase64Encoded: boolean
multiValueHeaders: APIGatewayProxyEventMultiValueHeaders
multiValueQueryStringParameters: null | APIGatewayProxyEventMultiValueQueryStringParameters
path: string
pathParameters: null | APIGatewayProxyEventPathParameters
queryStringParameters: null | APIGatewayProxyEventQueryStringParameters
requestContext: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext>
resource: string
stageVariables: null | APIGatewayProxyEventStageVariables
supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

Type declaration

  • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
    • cookies: string[]
    • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]

Generated using TypeDoc

\ No newline at end of file +SessionEvent | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SupertokensLambdaEvent
    • SessionEvent

Index

Properties

body: null | string
headers: APIGatewayProxyEventHeaders
httpMethod: string
isBase64Encoded: boolean
multiValueHeaders: APIGatewayProxyEventMultiValueHeaders
multiValueQueryStringParameters: null | APIGatewayProxyEventMultiValueQueryStringParameters
path: string
pathParameters: null | APIGatewayProxyEventPathParameters
queryStringParameters: null | APIGatewayProxyEventQueryStringParameters
requestContext: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext>
resource: string
stageVariables: null | APIGatewayProxyEventStageVariables
supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

Type declaration

  • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
    • cookies: string[]
    • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/framework_awsLambda.SessionEventV2.html b/docs/interfaces/framework_awsLambda.SessionEventV2.html index 4b55fe413..97a71787d 100644 --- a/docs/interfaces/framework_awsLambda.SessionEventV2.html +++ b/docs/interfaces/framework_awsLambda.SessionEventV2.html @@ -1 +1 @@ -SessionEventV2 | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SupertokensLambdaEventV2
    • SessionEventV2

Index

Properties

body?: string
cookies?: string[]
headers: APIGatewayProxyEventHeaders
isBase64Encoded: boolean
pathParameters?: APIGatewayProxyEventPathParameters
queryStringParameters?: APIGatewayProxyEventQueryStringParameters
rawPath: string
rawQueryString: string
requestContext: { accountId: string; apiId: string; authorizer?: { jwt: { claims: {}; scopes: string[] } }; domainName: string; domainPrefix: string; http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }; requestId: string; routeKey: string; stage: string; time: string; timeEpoch: number }

Type declaration

  • accountId: string
  • apiId: string
  • Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
    • jwt: { claims: {}; scopes: string[] }
      • claims: {}
        • [name: string]: string | number | boolean | string[]
      • scopes: string[]
  • domainName: string
  • domainPrefix: string
  • http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
    • method: string
    • path: string
    • protocol: string
    • sourceIp: string
    • userAgent: string
  • requestId: string
  • routeKey: string
  • stage: string
  • time: string
  • timeEpoch: number
routeKey: string
stageVariables?: APIGatewayProxyEventStageVariables
supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

Type declaration

  • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
    • cookies: string[]
    • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
version: string

Generated using TypeDoc

\ No newline at end of file +SessionEventV2 | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SupertokensLambdaEventV2
    • SessionEventV2

Index

Properties

body?: string
cookies?: string[]
headers: APIGatewayProxyEventHeaders
isBase64Encoded: boolean
pathParameters?: APIGatewayProxyEventPathParameters
queryStringParameters?: APIGatewayProxyEventQueryStringParameters
rawPath: string
rawQueryString: string
requestContext: { accountId: string; apiId: string; authorizer?: { jwt: { claims: {}; scopes: string[] } }; domainName: string; domainPrefix: string; http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }; requestId: string; routeKey: string; stage: string; time: string; timeEpoch: number }

Type declaration

  • accountId: string
  • apiId: string
  • Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
    • jwt: { claims: {}; scopes: string[] }
      • claims: {}
        • [name: string]: string | number | boolean | string[]
      • scopes: string[]
  • domainName: string
  • domainPrefix: string
  • http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
    • method: string
    • path: string
    • protocol: string
    • sourceIp: string
    • userAgent: string
  • requestId: string
  • routeKey: string
  • stage: string
  • time: string
  • timeEpoch: number
routeKey: string
stageVariables?: APIGatewayProxyEventStageVariables
supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

Type declaration

  • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
    • cookies: string[]
    • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
version: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/framework_express.SessionRequest.html b/docs/interfaces/framework_express.SessionRequest.html index af8bafcd6..4b916311a 100644 --- a/docs/interfaces/framework_express.SessionRequest.html +++ b/docs/interfaces/framework_express.SessionRequest.html @@ -118,7 +118,7 @@
route: any
secure: boolean

Short-hand for:

req.protocol == 'https'

-
session?: SessionContainer
signedCookies: any
socket: Socket
+
session?: SessionContainer
signedCookies: any
socket: Socket

The net.Socket object associated with the connection.

With HTTPS support, use request.socket.getPeerCertificate() to obtain the client's authentication details.

diff --git a/docs/interfaces/framework_fastify.SessionRequest.html b/docs/interfaces/framework_fastify.SessionRequest.html index c7a11b859..ec7881c26 100644 --- a/docs/interfaces/framework_fastify.SessionRequest.html +++ b/docs/interfaces/framework_fastify.SessionRequest.html @@ -1,4 +1,4 @@ SessionRequest | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • FastifyRequest
    • SessionRequest

Index

Properties

body: unknown
connection: Socket
headers: IncomingHttpHeaders
hostname: string
id: any
ip: string
ips?: string[]
is404: boolean
log: FastifyLoggerInstance
method: string
params: unknown
protocol: "http" | "https"
query: unknown
raw: IncomingMessage
req: IncomingMessage
deprecated

Use raw property

-
routerMethod: string
routerPath: string
socket: Socket
url: string
validationError?: Error & { validation: any; validationContext: string }
+
routerMethod: string
routerPath: string
socket: Socket
url: string
validationError?: Error & { validation: any; validationContext: string }

in order for this to be used the user should ensure they have set the attachValidation option.

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Interface
  • Property
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/framework_hapi.SessionRequest.html b/docs/interfaces/framework_hapi.SessionRequest.html index 86745e335..aa7cd3a71 100644 --- a/docs/interfaces/framework_hapi.SessionRequest.html +++ b/docs/interfaces/framework_hapi.SessionRequest.html @@ -89,7 +89,7 @@
server: Server

Access: read only and the public server interface. The server object.

-
session?: SessionContainer
state: Dictionary<any>
+
session?: SessionContainer
state: Dictionary<any>

An object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition.

url: URL

The parsed request URI.

diff --git a/docs/interfaces/framework_koa.SessionContext.html b/docs/interfaces/framework_koa.SessionContext.html index 571567953..f79bfd871 100644 --- a/docs/interfaces/framework_koa.SessionContext.html +++ b/docs/interfaces/framework_koa.SessionContext.html @@ -81,7 +81,7 @@
secure: boolean

Short-hand for:

this.protocol == 'https'

-
session?: SessionContainer
socket: Socket
+
session?: SessionContainer
socket: Socket

Return the request socket.

stale: boolean

Check if the request is stale, aka diff --git a/docs/interfaces/framework_loopback.SessionContext.html b/docs/interfaces/framework_loopback.SessionContext.html index 9b820e63a..eb1cb7fc7 100644 --- a/docs/interfaces/framework_loopback.SessionContext.html +++ b/docs/interfaces/framework_loopback.SessionContext.html @@ -14,7 +14,7 @@

A flag to tell if the response is finished.

scope: BindingScope

Scope for binding resolution

-
session?: SessionContainer
subscriptionManager: ContextSubscriptionManager
+
session?: SessionContainer
subscriptionManager: ContextSubscriptionManager

Manager for observer subscriptions

tagIndexer: ContextTagIndexer

Indexer for bindings by tag

diff --git a/docs/interfaces/recipe_session.SessionContainer.html b/docs/interfaces/recipe_session.SessionContainer.html index 24641ab3d..306e531d3 100644 --- a/docs/interfaces/recipe_session.SessionContainer.html +++ b/docs/interfaces/recipe_session.SessionContainer.html @@ -1,2 +1,2 @@ -SessionContainer | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SessionContainer

Index

Methods

  • fetchAndSetClaim<T>(claim: SessionClaim<T>, userContext?: any): Promise<void>
  • getAccessToken(userContext?: any): string
  • getAccessTokenPayload(userContext?: any): any
  • getClaimValue<T>(claim: SessionClaim<T>, userContext?: any): Promise<undefined | T>
  • getExpiry(userContext?: any): Promise<number>
  • getHandle(userContext?: any): string
  • getSessionData(userContext?: any): Promise<any>
  • getTimeCreated(userContext?: any): Promise<number>
  • getUserId(userContext?: any): string
  • mergeIntoAccessTokenPayload(accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<void>
  • removeClaim(claim: SessionClaim<any>, userContext?: any): Promise<void>
  • revokeSession(userContext?: any): Promise<void>
  • setClaimValue<T>(claim: SessionClaim<T>, value: T, userContext?: any): Promise<void>
  • updateAccessTokenPayload(newAccessTokenPayload: any, userContext?: any): Promise<void>
  • deprecated

    Use mergeIntoAccessTokenPayload instead

    -

    Parameters

    • newAccessTokenPayload: any
    • Optional userContext: any

    Returns Promise<void>

  • updateSessionData(newSessionData: any, userContext?: any): Promise<any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Interface
  • Method
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +SessionContainer | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SessionContainer

Index

Methods

  • fetchAndSetClaim<T>(claim: SessionClaim<T>, userContext?: any): Promise<void>
  • getAccessToken(userContext?: any): string
  • getAccessTokenPayload(userContext?: any): any
  • getClaimValue<T>(claim: SessionClaim<T>, userContext?: any): Promise<undefined | T>
  • getExpiry(userContext?: any): Promise<number>
  • getHandle(userContext?: any): string
  • getSessionData(userContext?: any): Promise<any>
  • getTimeCreated(userContext?: any): Promise<number>
  • getUserId(userContext?: any): string
  • mergeIntoAccessTokenPayload(accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<void>
  • removeClaim(claim: SessionClaim<any>, userContext?: any): Promise<void>
  • revokeSession(userContext?: any): Promise<void>
  • setClaimValue<T>(claim: SessionClaim<T>, value: T, userContext?: any): Promise<void>
  • updateAccessTokenPayload(newAccessTokenPayload: any, userContext?: any): Promise<void>
  • deprecated

    Use mergeIntoAccessTokenPayload instead

    +

    Parameters

    • newAccessTokenPayload: any
    • Optional userContext: any

    Returns Promise<void>

  • updateSessionData(newSessionData: any, userContext?: any): Promise<any>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Interface
  • Method
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/recipe_session.VerifySessionOptions.html b/docs/interfaces/recipe_session.VerifySessionOptions.html index c4839ae7d..ea9e20a1e 100644 --- a/docs/interfaces/recipe_session.VerifySessionOptions.html +++ b/docs/interfaces/recipe_session.VerifySessionOptions.html @@ -1 +1 @@ -VerifySessionOptions | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Interface
  • Property
  • Method
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +VerifySessionOptions | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Interface
  • Property
  • Method
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/framework.html b/docs/modules/framework.html index 6343746df..220db442e 100644 --- a/docs/modules/framework.html +++ b/docs/modules/framework.html @@ -1 +1 @@ -framework | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +framework | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/framework_awsLambda.html b/docs/modules/framework_awsLambda.html index 3e33b77aa..709303504 100644 --- a/docs/modules/framework_awsLambda.html +++ b/docs/modules/framework_awsLambda.html @@ -1 +1 @@ -framework/awsLambda | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/awsLambda

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +framework/awsLambda | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/awsLambda

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/framework_express.html b/docs/modules/framework_express.html index 058a2109b..0ffe798db 100644 --- a/docs/modules/framework_express.html +++ b/docs/modules/framework_express.html @@ -1 +1 @@ -framework/express | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/express

Index

Functions

  • errorHandler(): (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>
  • Returns (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>

      • (err: any, req: Request, res: Response, next: NextFunction): Promise<void>
      • Parameters

        • err: any
        • req: Request
        • res: Response
        • next: NextFunction

        Returns Promise<void>

  • middleware(): (req: Request, res: Response, next: NextFunction) => Promise<void>
  • Returns (req: Request, res: Response, next: NextFunction) => Promise<void>

      • (req: Request, res: Response, next: NextFunction): Promise<void>
      • Parameters

        • req: Request
        • res: Response
        • next: NextFunction

        Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +framework/express | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/express

Index

Functions

  • errorHandler(): (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>
  • Returns (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>

      • (err: any, req: Request, res: Response, next: NextFunction): Promise<void>
      • Parameters

        • err: any
        • req: Request
        • res: Response
        • next: NextFunction

        Returns Promise<void>

  • middleware(): (req: Request, res: Response, next: NextFunction) => Promise<void>
  • Returns (req: Request, res: Response, next: NextFunction) => Promise<void>

      • (req: Request, res: Response, next: NextFunction): Promise<void>
      • Parameters

        • req: Request
        • res: Response
        • next: NextFunction

        Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/framework_fastify.html b/docs/modules/framework_fastify.html index f8303095b..abdc5735b 100644 --- a/docs/modules/framework_fastify.html +++ b/docs/modules/framework_fastify.html @@ -1 +1 @@ -framework/fastify | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/fastify

Index

Functions

  • errorHandler(): (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>
  • Returns (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>

      • (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>): Promise<void>
      • Parameters

        • err: any
        • req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>
        • res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

        Returns Promise<void>

  • plugin(instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>, opts: Record<never, never>, done: (err?: Error) => void): void
  • Parameters

    • instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>
    • opts: Record<never, never>
    • done: (err?: Error) => void
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns void

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +framework/fastify | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/fastify

Index

Functions

  • errorHandler(): (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>
  • Returns (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>

      • (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>): Promise<void>
      • Parameters

        • err: any
        • req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>
        • res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

        Returns Promise<void>

  • plugin(instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>, opts: Record<never, never>, done: (err?: Error) => void): void
  • Parameters

    • instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>
    • opts: Record<never, never>
    • done: (err?: Error) => void
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns void

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/framework_hapi.html b/docs/modules/framework_hapi.html index b92debed5..f23fdbbdb 100644 --- a/docs/modules/framework_hapi.html +++ b/docs/modules/framework_hapi.html @@ -1 +1 @@ -framework/hapi | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/hapi

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +framework/hapi | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/hapi

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/framework_koa.html b/docs/modules/framework_koa.html index 25f413b03..3f4aca45c 100644 --- a/docs/modules/framework_koa.html +++ b/docs/modules/framework_koa.html @@ -1 +1 @@ -framework/koa | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/koa

Index

Functions

  • middleware(): (ctx: Context, next: Next) => Promise<void>
  • Returns (ctx: Context, next: Next) => Promise<void>

      • (ctx: Context, next: Next): Promise<void>
      • Parameters

        • ctx: Context
        • next: Next

        Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +framework/koa | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/koa

Index

Functions

  • middleware(): (ctx: Context, next: Next) => Promise<void>
  • Returns (ctx: Context, next: Next) => Promise<void>

      • (ctx: Context, next: Next): Promise<void>
      • Parameters

        • ctx: Context
        • next: Next

        Returns Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/framework_loopback.html b/docs/modules/framework_loopback.html index 6f5645d6a..8317b5295 100644 --- a/docs/modules/framework_loopback.html +++ b/docs/modules/framework_loopback.html @@ -1 +1 @@ -framework/loopback | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/loopback

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +framework/loopback | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module framework/loopback

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/index.html b/docs/modules/index.html index 7e09eb8b0..a9a9d4cd9 100644 --- a/docs/modules/index.html +++ b/docs/modules/index.html @@ -1 +1 @@ -index | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

Error: typeof default = SuperTokensWrapper.Error

Functions

  • createUserIdMapping(input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }): Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
  • Parameters

    • input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }
      • externalUserId: string
      • Optional externalUserIdInfo?: string
      • Optional force?: boolean
      • superTokensUserId: string

    Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>

  • deleteUser(userId: string): Promise<{ status: "OK" }>
  • deleteUserIdMapping(input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ didMappingExist: boolean; status: "OK" }>
  • Parameters

    • input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • Optional force?: boolean
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ didMappingExist: boolean; status: "OK" }>

  • getAllCORSHeaders(): string[]
  • getUserCount(includeRecipeIds?: string[]): Promise<number>
  • Parameters

    • Optional includeRecipeIds: string[]

    Returns Promise<number>

  • getUserIdMapping(input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
  • Parameters

    • input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>

  • getUsersNewestFirst(input?: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }): Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
  • Parameters

    • Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
      • Optional includeRecipeIds?: string[]
      • Optional limit?: number
      • Optional paginationToken?: string

    Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>

  • getUsersOldestFirst(input?: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }): Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
  • Parameters

    • Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
      • Optional includeRecipeIds?: string[]
      • Optional limit?: number
      • Optional paginationToken?: string

    Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>

  • init(config: TypeInput): void
  • updateOrDeleteUserIdMappingInfo(input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
  • Parameters

    • input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • Optional externalUserIdInfo?: string
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +index | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

Error: typeof default = SuperTokensWrapper.Error

Functions

  • createUserIdMapping(input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }): Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
  • Parameters

    • input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }
      • externalUserId: string
      • Optional externalUserIdInfo?: string
      • Optional force?: boolean
      • superTokensUserId: string

    Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>

  • deleteUser(userId: string): Promise<{ status: "OK" }>
  • deleteUserIdMapping(input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ didMappingExist: boolean; status: "OK" }>
  • Parameters

    • input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • Optional force?: boolean
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ didMappingExist: boolean; status: "OK" }>

  • getAllCORSHeaders(): string[]
  • getUserCount(includeRecipeIds?: string[]): Promise<number>
  • Parameters

    • Optional includeRecipeIds: string[]

    Returns Promise<number>

  • getUserIdMapping(input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
  • Parameters

    • input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>

  • getUsersNewestFirst(input?: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }): Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
  • Parameters

    • Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
      • Optional includeRecipeIds?: string[]
      • Optional limit?: number
      • Optional paginationToken?: string

    Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>

  • getUsersOldestFirst(input?: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }): Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
  • Parameters

    • Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
      • Optional includeRecipeIds?: string[]
      • Optional limit?: number
      • Optional paginationToken?: string

    Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>

  • init(config: TypeInput): void
  • updateOrDeleteUserIdMappingInfo(input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
  • Parameters

    • input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
      • Optional externalUserIdInfo?: string
      • userId: string
      • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

    Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_dashboard.html b/docs/modules/recipe_dashboard.html index 6ff0b036c..49659d11f 100644 --- a/docs/modules/recipe_dashboard.html +++ b/docs/modules/recipe_dashboard.html @@ -1 +1 @@ -recipe/dashboard | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/dashboard

Index

Type aliases

APIInterface: { dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>) }

Type declaration

  • dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>)
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

RecipeInterface: { getDashboardBundleLocation: any; shouldAllowAccess: any }

Type declaration

  • getDashboardBundleLocation:function
    • getDashboardBundleLocation(input: { userContext: any }): Promise<string>
  • shouldAllowAccess:function
    • shouldAllowAccess(input: { config: TypeNormalisedInput; req: BaseRequest; userContext: any }): Promise<boolean>

Functions

  • init(config?: TypeInput): RecipeListFunction

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +recipe/dashboard | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/dashboard

Index

Type aliases

APIInterface: { dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>) }

Type declaration

  • dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>)
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

RecipeInterface: { getDashboardBundleLocation: any; shouldAllowAccess: any }

Type declaration

  • getDashboardBundleLocation:function
    • getDashboardBundleLocation(input: { userContext: any }): Promise<string>
  • shouldAllowAccess:function
    • shouldAllowAccess(input: { config: TypeNormalisedInput; req: BaseRequest; userContext: any }): Promise<boolean>

Functions

  • init(config?: TypeInput): RecipeListFunction

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_emailpassword.html b/docs/modules/recipe_emailpassword.html index 9152f5383..4de076cfc 100644 --- a/docs/modules/recipe_emailpassword.html +++ b/docs/modules/recipe_emailpassword.html @@ -1 +1 @@ -recipe/emailpassword | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/emailpassword

Index

Type aliases

APIInterface: { emailExistsGET: undefined | ((input: { email: string; options: APIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>); signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>) }

Type declaration

  • emailExistsGET: undefined | ((input: { email: string; options: APIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
  • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>)
  • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
  • signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
  • signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailPasswordEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

RecipeInterface: { createResetPasswordToken: any; getUserByEmail: any; getUserById: any; resetPasswordUsingToken: any; signIn: any; signUp: any; updateEmailOrPassword: any }

Type declaration

  • createResetPasswordToken:function
    • createResetPasswordToken(input: { userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • Parameters

      • input: { userContext: any; userId: string }
        • userContext: any
        • userId: string

      Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

  • getUserByEmail:function
    • getUserByEmail(input: { email: string; userContext: any }): Promise<undefined | User>
  • getUserById:function
    • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
  • resetPasswordUsingToken:function
    • resetPasswordUsingToken(input: { newPassword: string; token: string; userContext: any }): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • Parameters

      • input: { newPassword: string; token: string; userContext: any }
        • newPassword: string
        • token: string
        • userContext: any

      Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

  • signIn:function
    • signIn(input: { email: string; password: string; userContext: any }): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • Parameters

      • input: { email: string; password: string; userContext: any }
        • email: string
        • password: string
        • userContext: any

      Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>

  • signUp:function
    • signUp(input: { email: string; password: string; userContext: any }): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { email: string; password: string; userContext: any }
        • email: string
        • password: string
        • userContext: any

      Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

  • updateEmailOrPassword:function
    • updateEmailOrPassword(input: { email?: string; password?: string; userContext: any; userId: string }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { email?: string; password?: string; userContext: any; userId: string }
        • Optional email?: string
        • Optional password?: string
        • userContext: any
        • userId: string

      Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>

User: { email: string; id: string; timeJoined: number }

Type declaration

  • email: string
  • id: string
  • timeJoined: number

Variables

Error: typeof default = Wrapper.Error

Functions

  • createResetPasswordToken(userId: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
  • getUserByEmail(email: string, userContext?: any): Promise<undefined | User>
  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • init(config?: TypeInput): RecipeListFunction
  • resetPasswordUsingToken(token: string, newPassword: string, userContext?: any): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
  • Parameters

    • token: string
    • newPassword: string
    • Optional userContext: any

    Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

  • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
  • signIn(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
  • signUp(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
  • updateEmailOrPassword(input: { email?: string; password?: string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
  • Parameters

    • input: { email?: string; password?: string; userContext?: any; userId: string }
      • Optional email?: string
      • Optional password?: string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +recipe/emailpassword | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/emailpassword

Index

Type aliases

APIInterface: { emailExistsGET: undefined | ((input: { email: string; options: APIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>); signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>) }

Type declaration

  • emailExistsGET: undefined | ((input: { email: string; options: APIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
  • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>)
  • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
  • signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
  • signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailPasswordEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

RecipeInterface: { createResetPasswordToken: any; getUserByEmail: any; getUserById: any; resetPasswordUsingToken: any; signIn: any; signUp: any; updateEmailOrPassword: any }

Type declaration

  • createResetPasswordToken:function
    • createResetPasswordToken(input: { userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • Parameters

      • input: { userContext: any; userId: string }
        • userContext: any
        • userId: string

      Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

  • getUserByEmail:function
    • getUserByEmail(input: { email: string; userContext: any }): Promise<undefined | User>
  • getUserById:function
    • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
  • resetPasswordUsingToken:function
    • resetPasswordUsingToken(input: { newPassword: string; token: string; userContext: any }): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • Parameters

      • input: { newPassword: string; token: string; userContext: any }
        • newPassword: string
        • token: string
        • userContext: any

      Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

  • signIn:function
    • signIn(input: { email: string; password: string; userContext: any }): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • Parameters

      • input: { email: string; password: string; userContext: any }
        • email: string
        • password: string
        • userContext: any

      Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>

  • signUp:function
    • signUp(input: { email: string; password: string; userContext: any }): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { email: string; password: string; userContext: any }
        • email: string
        • password: string
        • userContext: any

      Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

  • updateEmailOrPassword:function
    • updateEmailOrPassword(input: { email?: string; password?: string; userContext: any; userId: string }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { email?: string; password?: string; userContext: any; userId: string }
        • Optional email?: string
        • Optional password?: string
        • userContext: any
        • userId: string

      Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>

User: { email: string; id: string; timeJoined: number }

Type declaration

  • email: string
  • id: string
  • timeJoined: number

Variables

Error: typeof default = Wrapper.Error

Functions

  • createResetPasswordToken(userId: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
  • getUserByEmail(email: string, userContext?: any): Promise<undefined | User>
  • getUserById(userId: string, userContext?: any): Promise<undefined | User>
  • init(config?: TypeInput): RecipeListFunction
  • resetPasswordUsingToken(token: string, newPassword: string, userContext?: any): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
  • Parameters

    • token: string
    • newPassword: string
    • Optional userContext: any

    Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

  • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
  • signIn(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
  • signUp(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
  • updateEmailOrPassword(input: { email?: string; password?: string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
  • Parameters

    • input: { email?: string; password?: string; userContext?: any; userId: string }
      • Optional email?: string
      • Optional password?: string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_emailverification.html b/docs/modules/recipe_emailverification.html index 13687f3b1..d8f3670a8 100644 --- a/docs/modules/recipe_emailverification.html +++ b/docs/modules/recipe_emailverification.html @@ -1 +1 @@ -recipe/emailverification | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/emailverification

Index

Type aliases

APIInterface: { generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK" } | GeneralErrorResponse>); isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; status: "OK" } | GeneralErrorResponse>); verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; token: string; userContext: any }) => Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>) }

Type declaration

  • generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK" } | GeneralErrorResponse>)
  • isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; status: "OK" } | GeneralErrorResponse>)
  • verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; token: string; userContext: any }) => Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

  • appInfo: NormalisedAppinfo
  • config: TypeNormalisedInput
  • emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>
  • isInServerlessEnv: boolean
  • recipeId: string
  • recipeImplementation: RecipeInterface
  • req: BaseRequest
  • res: BaseResponse
RecipeInterface: { createEmailVerificationToken: any; isEmailVerified: any; revokeEmailVerificationTokens: any; unverifyEmail: any; verifyEmailUsingToken: any }

Type declaration

  • createEmailVerificationToken:function
    • createEmailVerificationToken(input: { email: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • Parameters

      • input: { email: string; userContext: any; userId: string }
        • email: string
        • userContext: any
        • userId: string

      Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>

  • isEmailVerified:function
    • isEmailVerified(input: { email: string; userContext: any; userId: string }): Promise<boolean>
  • revokeEmailVerificationTokens:function
    • revokeEmailVerificationTokens(input: { email: string; userContext: any; userId: string }): Promise<{ status: "OK" }>
  • unverifyEmail:function
    • unverifyEmail(input: { email: string; userContext: any; userId: string }): Promise<{ status: "OK" }>
  • verifyEmailUsingToken:function
    • verifyEmailUsingToken(input: { token: string; userContext: any }): Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
    • Parameters

      • input: { token: string; userContext: any }
        • token: string
        • userContext: any

      Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

User: { email: string; id: string }

Type declaration

  • email: string
  • id: string

Variables

EmailVerificationClaim: EmailVerificationClaimClass = ...
Error: typeof default = Wrapper.Error

Functions

  • createEmailVerificationToken(userId: string, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • init(config: TypeInput): RecipeListFunction
  • isEmailVerified(userId: string, email?: string, userContext?: any): Promise<boolean>
  • revokeEmailVerificationTokens(userId: string, email?: string, userContext?: any): Promise<{ status: string }>
  • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
  • unverifyEmail(userId: string, email?: string, userContext?: any): Promise<{ status: string }>
  • verifyEmailUsingToken(token: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +recipe/emailverification | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/emailverification

Index

Type aliases

APIInterface: { generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK" } | GeneralErrorResponse>); isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; status: "OK" } | GeneralErrorResponse>); verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; token: string; userContext: any }) => Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>) }

Type declaration

  • generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK" } | GeneralErrorResponse>)
  • isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; status: "OK" } | GeneralErrorResponse>)
  • verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; token: string; userContext: any }) => Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

  • appInfo: NormalisedAppinfo
  • config: TypeNormalisedInput
  • emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>
  • isInServerlessEnv: boolean
  • recipeId: string
  • recipeImplementation: RecipeInterface
  • req: BaseRequest
  • res: BaseResponse
RecipeInterface: { createEmailVerificationToken: any; isEmailVerified: any; revokeEmailVerificationTokens: any; unverifyEmail: any; verifyEmailUsingToken: any }

Type declaration

  • createEmailVerificationToken:function
    • createEmailVerificationToken(input: { email: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • Parameters

      • input: { email: string; userContext: any; userId: string }
        • email: string
        • userContext: any
        • userId: string

      Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>

  • isEmailVerified:function
    • isEmailVerified(input: { email: string; userContext: any; userId: string }): Promise<boolean>
  • revokeEmailVerificationTokens:function
    • revokeEmailVerificationTokens(input: { email: string; userContext: any; userId: string }): Promise<{ status: "OK" }>
  • unverifyEmail:function
    • unverifyEmail(input: { email: string; userContext: any; userId: string }): Promise<{ status: "OK" }>
  • verifyEmailUsingToken:function
    • verifyEmailUsingToken(input: { token: string; userContext: any }): Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
    • Parameters

      • input: { token: string; userContext: any }
        • token: string
        • userContext: any

      Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

User: { email: string; id: string }

Type declaration

  • email: string
  • id: string

Variables

EmailVerificationClaim: EmailVerificationClaimClass = ...
Error: typeof default = Wrapper.Error

Functions

  • createEmailVerificationToken(userId: string, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • init(config: TypeInput): RecipeListFunction
  • isEmailVerified(userId: string, email?: string, userContext?: any): Promise<boolean>
  • revokeEmailVerificationTokens(userId: string, email?: string, userContext?: any): Promise<{ status: string }>
  • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
  • unverifyEmail(userId: string, email?: string, userContext?: any): Promise<{ status: string }>
  • verifyEmailUsingToken(token: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_jwt.html b/docs/modules/recipe_jwt.html index 0b6a1129a..9abb732d8 100644 --- a/docs/modules/recipe_jwt.html +++ b/docs/modules/recipe_jwt.html @@ -1 +1 @@ -recipe/jwt | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

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

Type declaration

  • getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[]; status: "OK" } | GeneralErrorResponse>)
APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

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: { createJWT: any; getJWKS: any }

Type declaration

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

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

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

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

Functions

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

    • payload: any
    • Optional validitySeconds: number
    • Optional userContext: any

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

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; status: "OK" }>
  • init(config?: TypeInput): RecipeListFunction

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +recipe/jwt | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

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

Type declaration

  • getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[]; status: "OK" } | GeneralErrorResponse>)
APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

Type declaration

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: { createJWT: any; getJWKS: any }

Type declaration

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

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

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

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

Functions

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

    • payload: any
    • Optional validitySeconds: number
    • Optional userContext: any

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

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; status: "OK" }>
  • init(config?: TypeInput): RecipeListFunction

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_openid.html b/docs/modules/recipe_openid.html index 58ed9e939..699f8bf41 100644 --- a/docs/modules/recipe_openid.html +++ b/docs/modules/recipe_openid.html @@ -1 +1 @@ -recipe/openid | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/openid

Index

Functions

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

    • Optional payload: any
    • Optional validitySeconds: number
    • Optional userContext: any

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

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; status: "OK" }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
  • init(config?: TypeInput): RecipeListFunction

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +recipe/openid | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/openid

Index

Functions

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

    • Optional payload: any
    • Optional validitySeconds: number
    • Optional userContext: any

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

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; status: "OK" }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
  • init(config?: TypeInput): RecipeListFunction

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index 67039c233..aafe731b0 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1 +1 @@ -recipe/passwordless | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/passwordless

Index

Type aliases

APIInterface: { consumeCodePOST?: any; createCodePOST?: any; emailExistsGET?: any; phoneNumberExistsGET?: any; resendCodePOST?: any }

Type declaration

  • consumeCodePOST?:function
    • consumeCodePOST(input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; userContext: any })): Promise<GeneralErrorResponse | { createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; userContext: any })

      Returns Promise<GeneralErrorResponse | { createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCodePOST?:function
    • createCodePOST(input: ({ email: string } & { options: APIOptions; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; userContext: any })): Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" }>
    • Parameters

      • input: ({ email: string } & { options: APIOptions; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; userContext: any })

      Returns Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" }>

  • emailExistsGET?:function
    • emailExistsGET(input: { email: string; options: APIOptions; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
  • phoneNumberExistsGET?:function
    • phoneNumberExistsGET(input: { options: APIOptions; phoneNumber: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
  • resendCodePOST?:function
    • resendCodePOST(input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; userContext: any }): Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypePasswordlessEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; smsDelivery: default<TypePasswordlessSmsDeliveryInput> }

Type declaration

  • appInfo: NormalisedAppinfo
  • config: TypeNormalisedInput
  • emailDelivery: default<TypePasswordlessEmailDeliveryInput>
  • isInServerlessEnv: boolean
  • recipeId: string
  • recipeImplementation: RecipeInterface
  • req: BaseRequest
  • res: BaseResponse
  • smsDelivery: default<TypePasswordlessSmsDeliveryInput>
RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; getUserByEmail: any; getUserById: any; getUserByPhoneNumber: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; updateUser: any }

Type declaration

  • consumeCode:function
    • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }

      Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode:function
    • createCode(input: ({ email: string } & { userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createNewCodeForDevice:function
    • createNewCodeForDevice(input: { deviceId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; userContext: any; userInputCode?: string }
        • deviceId: string
        • userContext: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • getUserByEmail:function
    • getUserByEmail(input: { email: string; userContext: any }): Promise<undefined | User>
  • getUserById:function
    • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
  • getUserByPhoneNumber:function
    • getUserByPhoneNumber(input: { phoneNumber: string; userContext: any }): Promise<undefined | User>
  • listCodesByDeviceId:function
    • listCodesByDeviceId(input: { deviceId: string; userContext: any }): Promise<undefined | DeviceType>
  • listCodesByEmail:function
    • listCodesByEmail(input: { email: string; userContext: any }): Promise<DeviceType[]>
  • listCodesByPhoneNumber:function
    • listCodesByPhoneNumber(input: { phoneNumber: string; userContext: any }): Promise<DeviceType[]>
  • listCodesByPreAuthSessionId:function
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext: any }): Promise<undefined | DeviceType>
  • revokeAllCodes:function
    • revokeAllCodes(input: { email: string; userContext: any } | { phoneNumber: string; userContext: any }): Promise<{ status: "OK" }>
  • revokeCode:function
    • revokeCode(input: { codeId: string; userContext: any }): Promise<{ status: "OK" }>
  • updateUser:function
    • updateUser(input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }
        • Optional email?: string | null
        • Optional phoneNumber?: string | null
        • userContext: any
        • userId: string

      Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

User: { email?: string; id: string; phoneNumber?: string; timeJoined: number }

Type declaration

  • Optional email?: string
  • id: string
  • Optional phoneNumber?: string
  • timeJoined: number

Variables

Error: typeof default = Wrapper.Error

Functions

  • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
  • Parameters

    • input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }

    Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode(input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
  • Parameters

    • input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createMagicLink(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<string>
  • createNewCodeForDevice(input: { deviceId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
  • Parameters

    • input: { deviceId: string; userContext?: any; userInputCode?: string }
      • deviceId: string
      • Optional userContext?: any
      • Optional userInputCode?: string

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • getUserByEmail(input: { email: string; userContext?: any }): Promise<undefined | User>
  • getUserById(input: { userContext?: any; userId: string }): Promise<undefined | User>
  • getUserByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<undefined | User>
  • init(config: TypeInput): RecipeListFunction
  • listCodesByDeviceId(input: { deviceId: string; userContext?: any }): Promise<undefined | DeviceType>
  • listCodesByEmail(input: { email: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { preAuthSessionId: string; userContext?: any }
      • preAuthSessionId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • revokeAllCodes(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ status: "OK" }>
  • revokeCode(input: { codeId: string; userContext?: any }): Promise<{ status: "OK" }>
  • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
  • signInUp(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: string; user: User }>
  • Parameters

    • input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }

    Returns Promise<{ createdNewUser: boolean; status: string; user: User }>

  • updateUser(input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
  • Parameters

    • input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
      • Optional email?: null | string
      • Optional phoneNumber?: null | string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +recipe/passwordless | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/passwordless

Index

Type aliases

APIInterface: { consumeCodePOST?: any; createCodePOST?: any; emailExistsGET?: any; phoneNumberExistsGET?: any; resendCodePOST?: any }

Type declaration

  • consumeCodePOST?:function
    • consumeCodePOST(input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; userContext: any })): Promise<GeneralErrorResponse | { createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; userContext: any })

      Returns Promise<GeneralErrorResponse | { createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCodePOST?:function
    • createCodePOST(input: ({ email: string } & { options: APIOptions; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; userContext: any })): Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" }>
    • Parameters

      • input: ({ email: string } & { options: APIOptions; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; userContext: any })

      Returns Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" }>

  • emailExistsGET?:function
    • emailExistsGET(input: { email: string; options: APIOptions; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
  • phoneNumberExistsGET?:function
    • phoneNumberExistsGET(input: { options: APIOptions; phoneNumber: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
  • resendCodePOST?:function
    • resendCodePOST(input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; userContext: any }): Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>
APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypePasswordlessEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; smsDelivery: default<TypePasswordlessSmsDeliveryInput> }

Type declaration

  • appInfo: NormalisedAppinfo
  • config: TypeNormalisedInput
  • emailDelivery: default<TypePasswordlessEmailDeliveryInput>
  • isInServerlessEnv: boolean
  • recipeId: string
  • recipeImplementation: RecipeInterface
  • req: BaseRequest
  • res: BaseResponse
  • smsDelivery: default<TypePasswordlessSmsDeliveryInput>
RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; getUserByEmail: any; getUserById: any; getUserByPhoneNumber: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; updateUser: any }

Type declaration

  • consumeCode:function
    • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }

      Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode:function
    • createCode(input: ({ email: string } & { userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createNewCodeForDevice:function
    • createNewCodeForDevice(input: { deviceId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; userContext: any; userInputCode?: string }
        • deviceId: string
        • userContext: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • getUserByEmail:function
    • getUserByEmail(input: { email: string; userContext: any }): Promise<undefined | User>
  • getUserById:function
    • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
  • getUserByPhoneNumber:function
    • getUserByPhoneNumber(input: { phoneNumber: string; userContext: any }): Promise<undefined | User>
  • listCodesByDeviceId:function
    • listCodesByDeviceId(input: { deviceId: string; userContext: any }): Promise<undefined | DeviceType>
  • listCodesByEmail:function
    • listCodesByEmail(input: { email: string; userContext: any }): Promise<DeviceType[]>
  • listCodesByPhoneNumber:function
    • listCodesByPhoneNumber(input: { phoneNumber: string; userContext: any }): Promise<DeviceType[]>
  • listCodesByPreAuthSessionId:function
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext: any }): Promise<undefined | DeviceType>
  • revokeAllCodes:function
    • revokeAllCodes(input: { email: string; userContext: any } | { phoneNumber: string; userContext: any }): Promise<{ status: "OK" }>
  • revokeCode:function
    • revokeCode(input: { codeId: string; userContext: any }): Promise<{ status: "OK" }>
  • updateUser:function
    • updateUser(input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }
        • Optional email?: string | null
        • Optional phoneNumber?: string | null
        • userContext: any
        • userId: string

      Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

User: { email?: string; id: string; phoneNumber?: string; timeJoined: number }

Type declaration

  • Optional email?: string
  • id: string
  • Optional phoneNumber?: string
  • timeJoined: number

Variables

Error: typeof default = Wrapper.Error

Functions

  • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
  • Parameters

    • input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }

    Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode(input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
  • Parameters

    • input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createMagicLink(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<string>
  • createNewCodeForDevice(input: { deviceId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
  • Parameters

    • input: { deviceId: string; userContext?: any; userInputCode?: string }
      • deviceId: string
      • Optional userContext?: any
      • Optional userInputCode?: string

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • getUserByEmail(input: { email: string; userContext?: any }): Promise<undefined | User>
  • getUserById(input: { userContext?: any; userId: string }): Promise<undefined | User>
  • getUserByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<undefined | User>
  • init(config: TypeInput): RecipeListFunction
  • listCodesByDeviceId(input: { deviceId: string; userContext?: any }): Promise<undefined | DeviceType>
  • listCodesByEmail(input: { email: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<DeviceType[]>
  • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { preAuthSessionId: string; userContext?: any }
      • preAuthSessionId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • revokeAllCodes(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ status: "OK" }>
  • revokeCode(input: { codeId: string; userContext?: any }): Promise<{ status: "OK" }>
  • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
  • signInUp(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: string; user: User }>
  • Parameters

    • input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }

    Returns Promise<{ createdNewUser: boolean; status: string; user: User }>

  • updateUser(input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
  • Parameters

    • input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
      • Optional email?: null | string
      • Optional phoneNumber?: null | string
      • Optional userContext?: any
      • userId: string

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index 46793ee15..8e70488e4 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -1,15 +1,15 @@ -recipe/session | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/session

Index

Type aliases

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

Type declaration

  • mergeIntoAccessTokenPayload:function
    • mergeIntoAccessTokenPayload(input: { accessTokenPayloadUpdate: JSONObject; sessionHandle: string; userContext: any }): Promise<boolean>
  • refreshSession:function
  • regenerateAccessToken:function
    • regenerateAccessToken(input: { accessToken: string; newAccessTokenPayload?: any; userContext: any }): Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; userDataInJWT: any; userId: string }; status: "OK" }>
    • Parameters

      • input: { accessToken: string; newAccessTokenPayload?: any; userContext: any }
        • accessToken: string
        • Optional newAccessTokenPayload?: any
        • userContext: any

      Returns Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; userDataInJWT: any; userId: string }; status: "OK" }>

      Returns false if the sessionHandle does not exist

      +
  • removeClaim:function
    • removeClaim(input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }): Promise<boolean>
    • Parameters

      • input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }
        • claim: SessionClaim<any>
        • sessionHandle: string
        • userContext: any

      Returns Promise<boolean>

  • revokeAllSessionsForUser:function
    • revokeAllSessionsForUser(input: { userContext: any; userId: string }): Promise<string[]>
  • revokeMultipleSessions:function
    • revokeMultipleSessions(input: { sessionHandles: string[]; userContext: any }): Promise<string[]>
    • Parameters

      • input: { sessionHandles: string[]; userContext: any }
        • sessionHandles: string[]
        • userContext: any

      Returns Promise<string[]>

  • revokeSession:function
    • revokeSession(input: { sessionHandle: string; userContext: any }): Promise<boolean>
  • setClaimValue:function
    • setClaimValue<T>(input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any; value: T }): Promise<boolean>
    • Type parameters

      • T

      Parameters

      • input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any; value: T }
        • claim: SessionClaim<T>
        • sessionHandle: string
        • userContext: any
        • value: T

      Returns Promise<boolean>

  • updateAccessTokenPayload:function
    • updateAccessTokenPayload(input: { newAccessTokenPayload: any; sessionHandle: string; userContext: any }): Promise<boolean>
    • deprecated

      Use mergeIntoAccessTokenPayload instead

      Parameters

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

      Returns Promise<boolean>

      Returns false if the sessionHandle does not exist

      -
  • updateSessionData:function
    • updateSessionData(input: { newSessionData: any; sessionHandle: string; userContext: any }): Promise<boolean>
    • Parameters

      • input: { newSessionData: any; sessionHandle: string; userContext: any }
        • newSessionData: any
        • sessionHandle: string
        • userContext: any

      Returns Promise<boolean>

  • validateClaims:function
    • validateClaims(input: { accessTokenPayload: any; claimValidators: SessionClaimValidator[]; userContext: any; userId: string }): Promise<{ accessTokenPayloadUpdate?: any; invalidClaims: ClaimValidationError[] }>
  • validateClaimsInJWTPayload:function
    • validateClaimsInJWTPayload(input: { claimValidators: SessionClaimValidator[]; jwtPayload: JSONObject; userContext: any; userId: string }): Promise<{ invalidClaims: ClaimValidationError[]; status: "OK" }>
  • SessionClaimValidator: ({ claim: SessionClaim<any>; shouldRefetch: any } | {}) & { id: string; validate: any }
    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: typeof default = SessionWrapper.Error

    Functions

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

      • Optional payload: any
      • Optional validitySeconds: number
      • userContext: any = {}

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

    • createNewSession(req: any, res: any, userId: string, accessTokenPayload?: any, sessionData?: any, userContext?: any): Promise<SessionContainer>
    • fetchAndSetClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
    • getAllSessionHandlesForUser(userId: string, userContext?: any): Promise<string[]>
    • getClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, userContext?: any): Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
    • Type parameters

      • T

      Parameters

      • sessionHandle: string
      • claim: SessionClaim<T>
      • userContext: any = {}

      Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; status: "OK" }>
    • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
    • getSessionInformation(sessionHandle: string, userContext?: any): Promise<undefined | SessionInformation>
    • init(config?: TypeInput): RecipeListFunction
    • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
    • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
    • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
    • revokeAllSessionsForUser(userId: string, userContext?: any): Promise<string[]>
    • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
    • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
    • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
    • updateAccessTokenPayload(sessionHandle: string, newAccessTokenPayload: any, userContext?: any): Promise<boolean>
    • updateSessionData(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +
  • updateSessionData:function
    • updateSessionData(input: { newSessionData: any; sessionHandle: string; userContext: any }): Promise<boolean>
    • Parameters

      • input: { newSessionData: any; sessionHandle: string; userContext: any }
        • newSessionData: any
        • sessionHandle: string
        • userContext: any

      Returns Promise<boolean>

  • validateClaims:function
    • validateClaims(input: { accessTokenPayload: any; claimValidators: SessionClaimValidator[]; userContext: any; userId: string }): Promise<{ accessTokenPayloadUpdate?: any; invalidClaims: ClaimValidationError[] }>
  • validateClaimsInJWTPayload:function
    • validateClaimsInJWTPayload(input: { claimValidators: SessionClaimValidator[]; jwtPayload: JSONObject; userContext: any; userId: string }): Promise<{ invalidClaims: ClaimValidationError[]; status: "OK" }>
  • SessionClaimValidator: ({ claim: SessionClaim<any>; shouldRefetch: any } | {}) & { id: string; validate: any }
    SessionInformation: { accessTokenPayload: any; expiry: number; sessionData: any; sessionHandle: string; timeCreated: number; userId: string }

    Type declaration

    Variables

    Error: typeof default = SessionWrapper.Error

    Functions

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index 2a6ccfec5..a943e404c 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1 +1 @@ -recipe/thirdparty | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdparty

    Index

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { code: string; options: APIOptions; state: string; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>); signInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: APIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { code: string; options: APIOptions; state: string; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
    • signInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: APIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; providers: TypeProvider[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    RecipeInterface: { getUserById: any; getUserByThirdPartyInfo: any; getUsersByEmail: any; signInUp: any }

    Type declaration

    • getUserById:function
      • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
    • getUserByThirdPartyInfo:function
      • getUserByThirdPartyInfo(input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<undefined | User>
      • Parameters

        • input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<undefined | User>

    • getUsersByEmail:function
      • getUsersByEmail(input: { email: string; userContext: any }): Promise<User[]>
    • signInUp:function
      • signInUp(input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
      • Parameters

        • input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

    TypeProvider: { id: string; isDefault?: boolean; get: any }

    Type declaration

    • id: string
    • Optional isDefault?: boolean
    • get:function
      • get(redirectURI: undefined | string, authCodeFromRequest: undefined | string, userContext: any): TypeProviderGetResponse
    User: { email: string; id: string; thirdParty: { id: string; userId: string }; timeJoined: number }

    Type declaration

    • email: string
    • id: string
    • thirdParty: { id: string; userId: string }
      • id: string
      • userId: string
    • timeJoined: number

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • Apple(config: TypeThirdPartyProviderAppleConfig): TypeProvider
    • Discord(config: TypeThirdPartyProviderDiscordConfig): TypeProvider
    • Facebook(config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Github(config: TypeThirdPartyProviderGithubConfig): TypeProvider
    • Google(config: TypeThirdPartyProviderGoogleConfig): TypeProvider
    • GoogleWorkspaces(config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • getUserById(userId: string, userContext?: any): Promise<undefined | User>
    • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
    • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
    • init(config: TypeInput): RecipeListFunction
    • signInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
    • Parameters

      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • userContext: any = {}

      Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

    Generated using TypeDoc

    \ No newline at end of file +recipe/thirdparty | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdparty

    Index

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { code: string; options: APIOptions; state: string; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>); signInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: APIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { code: string; options: APIOptions; state: string; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
    • signInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: APIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; providers: TypeProvider[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    RecipeInterface: { getUserById: any; getUserByThirdPartyInfo: any; getUsersByEmail: any; signInUp: any }

    Type declaration

    • getUserById:function
      • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
    • getUserByThirdPartyInfo:function
      • getUserByThirdPartyInfo(input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<undefined | User>
      • Parameters

        • input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<undefined | User>

    • getUsersByEmail:function
      • getUsersByEmail(input: { email: string; userContext: any }): Promise<User[]>
    • signInUp:function
      • signInUp(input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
      • Parameters

        • input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

    TypeProvider: { id: string; isDefault?: boolean; get: any }

    Type declaration

    • id: string
    • Optional isDefault?: boolean
    • get:function
      • get(redirectURI: undefined | string, authCodeFromRequest: undefined | string, userContext: any): TypeProviderGetResponse
    User: { email: string; id: string; thirdParty: { id: string; userId: string }; timeJoined: number }

    Type declaration

    • email: string
    • id: string
    • thirdParty: { id: string; userId: string }
      • id: string
      • userId: string
    • timeJoined: number

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • Apple(config: TypeThirdPartyProviderAppleConfig): TypeProvider
    • Discord(config: TypeThirdPartyProviderDiscordConfig): TypeProvider
    • Facebook(config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Github(config: TypeThirdPartyProviderGithubConfig): TypeProvider
    • Google(config: TypeThirdPartyProviderGoogleConfig): TypeProvider
    • GoogleWorkspaces(config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • getUserById(userId: string, userContext?: any): Promise<undefined | User>
    • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
    • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
    • init(config: TypeInput): RecipeListFunction
    • signInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
    • Parameters

      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • userContext: any = {}

      Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index 14a122ba1..531205635 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1 +1 @@ -recipe/thirdpartyemailpassword | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartyemailpassword

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>); emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>); thirdPartySignInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
    • emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
    • emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
    • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>)
    • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
    • thirdPartySignInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>)
    EmailPasswordAPIOptions: APIOptions
    RecipeInterface: { createResetPasswordToken: any; emailPasswordSignIn: any; emailPasswordSignUp: any; getUserById: any; getUserByThirdPartyInfo: any; getUsersByEmail: any; resetPasswordUsingToken: any; thirdPartySignInUp: any; updateEmailOrPassword: any }

    Type declaration

    • createResetPasswordToken:function
      • createResetPasswordToken(input: { userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn:function
      • emailPasswordSignIn(input: { email: string; password: string; userContext: any }): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp:function
      • emailPasswordSignUp(input: { email: string; password: string; userContext: any }): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • getUserById:function
      • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
    • getUserByThirdPartyInfo:function
      • getUserByThirdPartyInfo(input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<undefined | User>
    • getUsersByEmail:function
      • getUsersByEmail(input: { email: string; userContext: any }): Promise<User[]>
    • resetPasswordUsingToken:function
      • resetPasswordUsingToken(input: { newPassword: string; token: string; userContext: any }): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { newPassword: string; token: string; userContext: any }
          • newPassword: string
          • token: string
          • userContext: any

        Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
      • Parameters

        • input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

    • updateEmailOrPassword:function
      • updateEmailOrPassword(input: { email?: string; password?: string; userContext: any; userId: string }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email?: string; password?: string; userContext: any; userId: string }
          • Optional email?: string
          • Optional password?: string
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>

    ThirdPartyAPIOptions: APIOptions
    User: { email: string; id: string; thirdParty?: { id: string; userId: string }; timeJoined: number }

    Type declaration

    • email: string
    • id: string
    • Optional thirdParty?: { id: string; userId: string }
      • id: string
      • userId: string
    • timeJoined: number

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • Apple(config: TypeThirdPartyProviderAppleConfig): TypeProvider
    • Discord(config: TypeThirdPartyProviderDiscordConfig): TypeProvider
    • Facebook(config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Github(config: TypeThirdPartyProviderGithubConfig): TypeProvider
    • Google(config: TypeThirdPartyProviderGoogleConfig): TypeProvider
    • GoogleWorkspaces(config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • createResetPasswordToken(userId: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • getUserById(userId: string, userContext?: any): Promise<undefined | User>
    • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
    • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
    • init(config: TypeInput): RecipeListFunction
    • resetPasswordUsingToken(token: string, newPassword: string, userContext?: any): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartySignInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
    • updateEmailOrPassword(input: { email?: string; password?: string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
    • Parameters

      • input: { email?: string; password?: string; userContext?: any; userId: string }
        • Optional email?: string
        • Optional password?: string
        • Optional userContext?: any
        • userId: string

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file +recipe/thirdpartyemailpassword | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartyemailpassword

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>); emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>); thirdPartySignInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
    • emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
    • emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
    • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>)
    • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
    • thirdPartySignInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>)
    EmailPasswordAPIOptions: APIOptions
    RecipeInterface: { createResetPasswordToken: any; emailPasswordSignIn: any; emailPasswordSignUp: any; getUserById: any; getUserByThirdPartyInfo: any; getUsersByEmail: any; resetPasswordUsingToken: any; thirdPartySignInUp: any; updateEmailOrPassword: any }

    Type declaration

    • createResetPasswordToken:function
      • createResetPasswordToken(input: { userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn:function
      • emailPasswordSignIn(input: { email: string; password: string; userContext: any }): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp:function
      • emailPasswordSignUp(input: { email: string; password: string; userContext: any }): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • getUserById:function
      • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
    • getUserByThirdPartyInfo:function
      • getUserByThirdPartyInfo(input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<undefined | User>
    • getUsersByEmail:function
      • getUsersByEmail(input: { email: string; userContext: any }): Promise<User[]>
    • resetPasswordUsingToken:function
      • resetPasswordUsingToken(input: { newPassword: string; token: string; userContext: any }): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { newPassword: string; token: string; userContext: any }
          • newPassword: string
          • token: string
          • userContext: any

        Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
      • Parameters

        • input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

    • updateEmailOrPassword:function
      • updateEmailOrPassword(input: { email?: string; password?: string; userContext: any; userId: string }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email?: string; password?: string; userContext: any; userId: string }
          • Optional email?: string
          • Optional password?: string
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>

    ThirdPartyAPIOptions: APIOptions
    User: { email: string; id: string; thirdParty?: { id: string; userId: string }; timeJoined: number }

    Type declaration

    • email: string
    • id: string
    • Optional thirdParty?: { id: string; userId: string }
      • id: string
      • userId: string
    • timeJoined: number

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • Apple(config: TypeThirdPartyProviderAppleConfig): TypeProvider
    • Discord(config: TypeThirdPartyProviderDiscordConfig): TypeProvider
    • Facebook(config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Github(config: TypeThirdPartyProviderGithubConfig): TypeProvider
    • Google(config: TypeThirdPartyProviderGoogleConfig): TypeProvider
    • GoogleWorkspaces(config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • createResetPasswordToken(userId: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(email: string, password: string, userContext?: any): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • getUserById(userId: string, userContext?: any): Promise<undefined | User>
    • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
    • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
    • init(config: TypeInput): RecipeListFunction
    • resetPasswordUsingToken(token: string, newPassword: string, userContext?: any): Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartySignInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
    • updateEmailOrPassword(input: { email?: string; password?: string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
    • Parameters

      • input: { email?: string; password?: string; userContext?: any; userId: string }
        • Optional email?: string
        • Optional password?: string
        • Optional userContext?: any
        • userId: string

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index c435a65ef..d15883574 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1 +1 @@ -recipe/thirdpartypasswordless | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartypasswordless

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>); consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" }>); createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | GeneralErrorResponse>); passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>); thirdPartySignInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
    • consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" }>)
    • createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | GeneralErrorResponse>)
    • passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>)
    • thirdPartySignInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>)
    PasswordlessAPIOptions: APIOptions
    RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; getUserById: any; getUserByPhoneNumber: any; getUserByThirdPartyInfo: any; getUsersByEmail: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; thirdPartySignInUp: any; updatePasswordlessUser: any }

    Type declaration

    • consumeCode:function
      • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }

        Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode:function
      • createCode(input: ({ email: string } & { userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
      • Parameters

        • input: ({ email: string } & { userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext: any; userInputCode?: string })

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createNewCodeForDevice:function
      • createNewCodeForDevice(input: { deviceId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
      • Parameters

        • input: { deviceId: string; userContext: any; userInputCode?: string }
          • deviceId: string
          • userContext: any
          • Optional userInputCode?: string

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • getUserById:function
      • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
    • getUserByPhoneNumber:function
      • getUserByPhoneNumber(input: { phoneNumber: string; userContext: any }): Promise<undefined | User>
    • getUserByThirdPartyInfo:function
      • getUserByThirdPartyInfo(input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<undefined | User>
    • getUsersByEmail:function
      • getUsersByEmail(input: { email: string; userContext: any }): Promise<User[]>
    • listCodesByDeviceId:function
      • listCodesByDeviceId(input: { deviceId: string; userContext: any }): Promise<undefined | DeviceType>
    • listCodesByEmail:function
      • listCodesByEmail(input: { email: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber:function
      • listCodesByPhoneNumber(input: { phoneNumber: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId:function
      • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext: any }): Promise<undefined | DeviceType>
    • revokeAllCodes:function
      • revokeAllCodes(input: { email: string; userContext: any } | { phoneNumber: string; userContext: any }): Promise<{ status: "OK" }>
    • revokeCode:function
      • revokeCode(input: { codeId: string; userContext: any }): Promise<{ status: "OK" }>
    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
      • Parameters

        • input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

    • updatePasswordlessUser:function
      • updatePasswordlessUser(input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }
          • Optional email?: string | null
          • Optional phoneNumber?: string | null
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

    ThirdPartyAPIOptions: APIOptions
    User: ({ email?: string; phoneNumber?: string } | { email: string; thirdParty: { id: string; userId: string } }) & { id: string; timeJoined: number }

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • Apple(config: TypeThirdPartyProviderAppleConfig): TypeProvider
    • Discord(config: TypeThirdPartyProviderDiscordConfig): TypeProvider
    • Facebook(config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Github(config: TypeThirdPartyProviderGithubConfig): TypeProvider
    • Google(config: TypeThirdPartyProviderGoogleConfig): TypeProvider
    • GoogleWorkspaces(config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }

      Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • getUserById(userId: string, userContext?: any): Promise<undefined | User>
    • getUserByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<undefined | User>
    • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
    • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
    • init(config: TypeInput): RecipeListFunction
    • listCodesByDeviceId(input: { deviceId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext?: any }): Promise<undefined | DeviceType>
    • passwordlessSignInUp(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: string; user: User }>
    • revokeAllCodes(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartySignInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • Optional userContext?: any
        • userId: string

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file +recipe/thirdpartypasswordless | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartypasswordless

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>); consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" }>); createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | GeneralErrorResponse>); passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>); thirdPartySignInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
    • consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" }>)
    • createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | GeneralErrorResponse>)
    • passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>)
    • thirdPartySignInUpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>)
    PasswordlessAPIOptions: APIOptions
    RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; getUserById: any; getUserByPhoneNumber: any; getUserByThirdPartyInfo: any; getUsersByEmail: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; thirdPartySignInUp: any; updatePasswordlessUser: any }

    Type declaration

    • consumeCode:function
      • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }

        Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode:function
      • createCode(input: ({ email: string } & { userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
      • Parameters

        • input: ({ email: string } & { userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext: any; userInputCode?: string })

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createNewCodeForDevice:function
      • createNewCodeForDevice(input: { deviceId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
      • Parameters

        • input: { deviceId: string; userContext: any; userInputCode?: string }
          • deviceId: string
          • userContext: any
          • Optional userInputCode?: string

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • getUserById:function
      • getUserById(input: { userContext: any; userId: string }): Promise<undefined | User>
    • getUserByPhoneNumber:function
      • getUserByPhoneNumber(input: { phoneNumber: string; userContext: any }): Promise<undefined | User>
    • getUserByThirdPartyInfo:function
      • getUserByThirdPartyInfo(input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<undefined | User>
    • getUsersByEmail:function
      • getUsersByEmail(input: { email: string; userContext: any }): Promise<User[]>
    • listCodesByDeviceId:function
      • listCodesByDeviceId(input: { deviceId: string; userContext: any }): Promise<undefined | DeviceType>
    • listCodesByEmail:function
      • listCodesByEmail(input: { email: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber:function
      • listCodesByPhoneNumber(input: { phoneNumber: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId:function
      • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext: any }): Promise<undefined | DeviceType>
    • revokeAllCodes:function
      • revokeAllCodes(input: { email: string; userContext: any } | { phoneNumber: string; userContext: any }): Promise<{ status: "OK" }>
    • revokeCode:function
      • revokeCode(input: { codeId: string; userContext: any }): Promise<{ status: "OK" }>
    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
      • Parameters

        • input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>

    • updatePasswordlessUser:function
      • updatePasswordlessUser(input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }
          • Optional email?: string | null
          • Optional phoneNumber?: string | null
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

    ThirdPartyAPIOptions: APIOptions
    User: ({ email?: string; phoneNumber?: string } | { email: string; thirdParty: { id: string; userId: string } }) & { id: string; timeJoined: number }

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • Apple(config: TypeThirdPartyProviderAppleConfig): TypeProvider
    • Discord(config: TypeThirdPartyProviderDiscordConfig): TypeProvider
    • Facebook(config: TypeThirdPartyProviderFacebookConfig): TypeProvider
    • Github(config: TypeThirdPartyProviderGithubConfig): TypeProvider
    • Google(config: TypeThirdPartyProviderGoogleConfig): TypeProvider
    • GoogleWorkspaces(config: TypeThirdPartyProviderGoogleWorkspacesConfig): TypeProvider
    • consumeCode(input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }

      Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • getUserById(userId: string, userContext?: any): Promise<undefined | User>
    • getUserByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<undefined | User>
    • getUserByThirdPartyInfo(thirdPartyId: string, thirdPartyUserId: string, userContext?: any): Promise<undefined | User>
    • getUsersByEmail(email: string, userContext?: any): Promise<User[]>
    • init(config: TypeInput): RecipeListFunction
    • listCodesByDeviceId(input: { deviceId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; userContext?: any }): Promise<undefined | DeviceType>
    • passwordlessSignInUp(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ createdNewUser: boolean; status: string; user: User }>
    • revokeAllCodes(input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartySignInUp(thirdPartyId: string, thirdPartyUserId: string, email: string, userContext?: any): Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • Optional userContext?: any
        • userId: string

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_usermetadata.html b/docs/modules/recipe_usermetadata.html index 3bf69f777..4de23852e 100644 --- a/docs/modules/recipe_usermetadata.html +++ b/docs/modules/recipe_usermetadata.html @@ -1,4 +1,4 @@ -recipe/usermetadata | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/usermetadata

    Index

    Type aliases

    RecipeInterface: { clearUserMetadata: any; getUserMetadata: any; updateUserMetadata: any }

    Type declaration

    • clearUserMetadata:function
      • clearUserMetadata(input: { userContext: any; userId: string }): Promise<{ status: "OK" }>
    • getUserMetadata:function
      • getUserMetadata(input: { userContext: any; userId: string }): Promise<{ metadata: any; status: "OK" }>
    • updateUserMetadata:function
      • updateUserMetadata(input: { metadataUpdate: JSONObject; userContext: any; userId: string }): Promise<{ metadata: JSONObject; status: "OK" }>
      • +recipe/usermetadata | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/usermetadata

        Index

        Type aliases

        RecipeInterface: { clearUserMetadata: any; getUserMetadata: any; updateUserMetadata: any }

        Type declaration

        • clearUserMetadata:function
          • clearUserMetadata(input: { userContext: any; userId: string }): Promise<{ status: "OK" }>
        • getUserMetadata:function
          • getUserMetadata(input: { userContext: any; userId: string }): Promise<{ metadata: any; status: "OK" }>
        • updateUserMetadata:function
          • updateUserMetadata(input: { metadataUpdate: JSONObject; userContext: any; userId: string }): Promise<{ metadata: JSONObject; status: "OK" }>
          • Updates the metadata object of the user by doing a shallow merge of the stored and the update JSONs and removing properties set to null on the root level of the update object. e.g.:

            @@ -7,4 +7,4 @@
          • update: { "notifications": { "sms": true }, "todos": null }
          • result: { "preferences": { "theme":"dark" }, "notifications": { "sms": true } }
          -

        Parameters

        • input: { metadataUpdate: JSONObject; userContext: any; userId: string }
          • metadataUpdate: JSONObject
          • userContext: any
          • userId: string

        Returns Promise<{ metadata: JSONObject; status: "OK" }>

    Functions

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • init(config?: TypeInput): RecipeListFunction
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    Returns Promise<{ metadata: JSONObject; status: "OK" }>

    Functions

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_userroles.html b/docs/modules/recipe_userroles.html index d53203262..6f565c663 100644 --- a/docs/modules/recipe_userroles.html +++ b/docs/modules/recipe_userroles.html @@ -1 +1 @@ -recipe/userroles | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/userroles

    Index

    Type aliases

    RecipeInterface: { addRoleToUser: any; createNewRoleOrAddPermissions: any; deleteRole: any; getAllRoles: any; getPermissionsForRole: any; getRolesForUser: any; getRolesThatHavePermission: any; getUsersThatHaveRole: any; removePermissionsFromRole: any; removeUserRole: any }

    Type declaration

    • addRoleToUser:function
      • addRoleToUser(input: { role: string; userContext: any; userId: string }): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any; userId: string }
          • role: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions:function
      • createNewRoleOrAddPermissions(input: { permissions: string[]; role: string; userContext: any }): Promise<{ createdNewRole: boolean; status: "OK" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ createdNewRole: boolean; status: "OK" }>

    • deleteRole:function
      • deleteRole(input: { role: string; userContext: any }): Promise<{ didRoleExist: boolean; status: "OK" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ didRoleExist: boolean; status: "OK" }>

    • getAllRoles:function
      • getAllRoles(input: { userContext: any }): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole:function
      • getPermissionsForRole(input: { role: string; userContext: any }): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser:function
      • getRolesForUser(input: { userContext: any; userId: string }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { userContext: any; userId: string }
          • userContext: any
          • userId: string

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getRolesThatHavePermission:function
      • getRolesThatHavePermission(input: { permission: string; userContext: any }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { permission: string; userContext: any }
          • permission: string
          • userContext: any

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getUsersThatHaveRole:function
      • getUsersThatHaveRole(input: { role: string; userContext: any }): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole:function
      • removePermissionsFromRole(input: { permissions: string[]; role: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>

    • removeUserRole:function
      • removeUserRole(input: { role: string; userContext: any; userId: string }): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any; userId: string }
          • role: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Variables

    PermissionClaim: PermissionClaimClass = ...
    UserRoleClaim: UserRoleClaimClass = ...

    Functions

    • addRoleToUser(userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • init(config?: TypeInput): RecipeListFunction
    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file +recipe/userroles | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/userroles

    Index

    Type aliases

    RecipeInterface: { addRoleToUser: any; createNewRoleOrAddPermissions: any; deleteRole: any; getAllRoles: any; getPermissionsForRole: any; getRolesForUser: any; getRolesThatHavePermission: any; getUsersThatHaveRole: any; removePermissionsFromRole: any; removeUserRole: any }

    Type declaration

    • addRoleToUser:function
      • addRoleToUser(input: { role: string; userContext: any; userId: string }): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any; userId: string }
          • role: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions:function
      • createNewRoleOrAddPermissions(input: { permissions: string[]; role: string; userContext: any }): Promise<{ createdNewRole: boolean; status: "OK" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ createdNewRole: boolean; status: "OK" }>

    • deleteRole:function
      • deleteRole(input: { role: string; userContext: any }): Promise<{ didRoleExist: boolean; status: "OK" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ didRoleExist: boolean; status: "OK" }>

    • getAllRoles:function
      • getAllRoles(input: { userContext: any }): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole:function
      • getPermissionsForRole(input: { role: string; userContext: any }): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser:function
      • getRolesForUser(input: { userContext: any; userId: string }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { userContext: any; userId: string }
          • userContext: any
          • userId: string

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getRolesThatHavePermission:function
      • getRolesThatHavePermission(input: { permission: string; userContext: any }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { permission: string; userContext: any }
          • permission: string
          • userContext: any

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getUsersThatHaveRole:function
      • getUsersThatHaveRole(input: { role: string; userContext: any }): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole:function
      • removePermissionsFromRole(input: { permissions: string[]; role: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>

    • removeUserRole:function
      • removeUserRole(input: { role: string; userContext: any; userId: string }): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any; userId: string }
          • role: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Variables

    PermissionClaim: PermissionClaimClass = ...
    UserRoleClaim: UserRoleClaimClass = ...

    Functions

    • addRoleToUser(userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • init(config?: TypeInput): RecipeListFunction
    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file