Migration from the old version of SuperTokens
The older library was called supertokens-node-<db name>-ref-jwt
. Now, you only need to use supertokens-node
library regardless of the database.
With express
- Import statement changes as seen here.
- Config changes:
- All the configs are now set in the
config.yaml
file which is provided to the SuperTokens core server. - The only config that the Node library takes is a list containing SuperTokens instances' IP and port as shown here
- All the configs are now set in the
- The
init
function now returnsvoid
instead ofPromise<void>
- The
jwtPayload
param must only be of typeobject
. - The
sessionData
param must only be of typeobject
. userId
must be of typestring
. Earlier, we would acceptnumber
orstring
.
Without express
- Import statement changes as seen here.
- Config changes:
- All the configs are now set in the
config.yaml
file which is provided to the SuperTokens core server. - The only config that the Node library takes is a list containing SuperTokens instances' IP and port as shown here
- All the configs are now set in the
- The
init
function now returnsvoid
instead ofPromise<void>
- The
jwtPayload
param must only be of typeobject
. - The
sessionData
param must only be of typeobject
. userId
must be of typestring
. Earlier, we would acceptnumber
orstring
.- The return type of most of the functions have changed. Please go through all of them. If you need assistance in migration, please contact us
Errors
UNAUTHORISED_AND_TOKEN_THEFT_DETECTED
is now calledTOKEN_THEFT_DETECTED
as shown here.