Search
Preparing search index...
The search index is not available
supertokens-node
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
supertokens-node
recipe/session
default
Class default
Hierarchy
default
Index
Constructors
constructor
Properties
Error
init
Methods
createJWT
create
New
Session
get
All
Session
Handles
For
User
getJWKS
get
Open
Id
Discovery
Configuration
get
Session
get
Session
Information
refresh
Session
regenerate
Access
Token
revoke
All
Sessions
For
User
revoke
Multiple
Sessions
revoke
Session
update
Access
Token
Payload
update
Session
Data
Constructors
constructor
new default
(
)
:
default
Returns
default
Properties
Static
Error
Error
:
typeof
default
= SuperTokensError
Static
init
init
:
(
(
config
?:
TypeInput
)
=>
RecipeListFunction
)
= Recipe.init
Type declaration
(
config
?:
TypeInput
)
:
RecipeListFunction
Parameters
Optional
config:
TypeInput
Returns
RecipeListFunction
Methods
Static
createJWT
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"
}
>
Static
create
New
Session
create
New
Session
(
res
:
any
, userId
:
string
, accessTokenPayload
?:
any
, sessionData
?:
any
, userContext
?:
any
)
:
Promise
<
SessionContainer
>
Parameters
res:
any
userId:
string
accessTokenPayload:
any
= {}
sessionData:
any
= {}
userContext:
any
= {}
Returns
Promise
<
SessionContainer
>
Static
get
All
Session
Handles
For
User
get
All
Session
Handles
For
User
(
userId
:
string
, userContext
?:
any
)
:
Promise
<
string
[]
>
Parameters
userId:
string
userContext:
any
= {}
Returns
Promise
<
string
[]
>
Static
getJWKS
getJWKS
(
userContext
?:
any
)
:
Promise
<
{
keys
:
JsonWebKey
[]
;
status
:
"OK"
}
>
Parameters
userContext:
any
= {}
Returns
Promise
<
{
keys
:
JsonWebKey
[]
;
status
:
"OK"
}
>
Static
get
Open
Id
Discovery
Configuration
get
Open
Id
Discovery
Configuration
(
userContext
?:
any
)
:
Promise
<
{
issuer
:
string
;
jwks_uri
:
string
;
status
:
"OK"
}
>
Parameters
userContext:
any
= {}
Returns
Promise
<
{
issuer
:
string
;
jwks_uri
:
string
;
status
:
"OK"
}
>
Static
get
Session
get
Session
(
req
:
any
, res
:
any
)
:
Promise
<
SessionContainer
>
get
Session
(
req
:
any
, res
:
any
, options
?:
VerifySessionOptions
&
{
sessionRequired
?:
true
}
, userContext
?:
any
)
:
Promise
<
SessionContainer
>
get
Session
(
req
:
any
, res
:
any
, options
?:
VerifySessionOptions
&
{
sessionRequired
:
false
}
, userContext
?:
any
)
:
Promise
<
undefined
|
SessionContainer
>
Parameters
req:
any
res:
any
Returns
Promise
<
SessionContainer
>
Parameters
req:
any
res:
any
Optional
options:
VerifySessionOptions
&
{
sessionRequired
?:
true
}
Optional
userContext:
any
Returns
Promise
<
SessionContainer
>
Parameters
req:
any
res:
any
Optional
options:
VerifySessionOptions
&
{
sessionRequired
:
false
}
Optional
userContext:
any
Returns
Promise
<
undefined
|
SessionContainer
>
Static
get
Session
Information
get
Session
Information
(
sessionHandle
:
string
, userContext
?:
any
)
:
Promise
<
undefined
|
SessionInformation
>
Parameters
sessionHandle:
string
userContext:
any
= {}
Returns
Promise
<
undefined
|
SessionInformation
>
Static
refresh
Session
refresh
Session
(
req
:
any
, res
:
any
, userContext
?:
any
)
:
Promise
<
SessionContainer
>
Parameters
req:
any
res:
any
userContext:
any
= {}
Returns
Promise
<
SessionContainer
>
Static
regenerate
Access
Token
regenerate
Access
Token
(
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"
}
>
Static
revoke
All
Sessions
For
User
revoke
All
Sessions
For
User
(
userId
:
string
, userContext
?:
any
)
:
Promise
<
string
[]
>
Parameters
userId:
string
userContext:
any
= {}
Returns
Promise
<
string
[]
>
Static
revoke
Multiple
Sessions
revoke
Multiple
Sessions
(
sessionHandles
:
string
[]
, userContext
?:
any
)
:
Promise
<
string
[]
>
Parameters
sessionHandles:
string
[]
userContext:
any
= {}
Returns
Promise
<
string
[]
>
Static
revoke
Session
revoke
Session
(
sessionHandle
:
string
, userContext
?:
any
)
:
Promise
<
boolean
>
Parameters
sessionHandle:
string
userContext:
any
= {}
Returns
Promise
<
boolean
>
Static
update
Access
Token
Payload
update
Access
Token
Payload
(
sessionHandle
:
string
, newAccessTokenPayload
:
any
, userContext
?:
any
)
:
Promise
<
boolean
>
Parameters
sessionHandle:
string
newAccessTokenPayload:
any
userContext:
any
= {}
Returns
Promise
<
boolean
>
Static
update
Session
Data
update
Session
Data
(
sessionHandle
:
string
, newSessionData
:
any
, userContext
?:
any
)
:
Promise
<
boolean
>
Parameters
sessionHandle:
string
newSessionData:
any
userContext:
any
= {}
Returns
Promise
<
boolean
>
Modules
framework
framework/aws
Lambda
framework/express
framework/fastify
framework/hapi
framework/koa
framework/loopback
index
ingredients/emaildelivery
ingredients/smsdelivery
recipe/emailpassword
recipe/emailverification
recipe/jwt
recipe/openid
recipe/passwordless
recipe/session
recipe/thirdparty
recipe/thirdpartyemailpassword
recipe/thirdpartypasswordless
recipe/usermetadata
recipe/userroles
default
constructor
Error
init
createJWT
create
New
Session
get
All
Session
Handles
For
User
getJWKS
get
Open
Id
Discovery
Configuration
get
Session
get
Session
Information
refresh
Session
regenerate
Access
Token
revoke
All
Sessions
For
User
revoke
Multiple
Sessions
revoke
Session
update
Access
Token
Payload
update
Session
Data
Generated using
TypeDoc