Initialization
This needs to be done only at the start of your Node app. If it fails, then you should restart your Node app.
Import the package
const supertokens = require("supertokens-node");
import * as supertokens from "supertokens-node";
Configure
let config = [{
hostname: "localhost",
port: 3567 // default port
}];
interface HostProperty {
hostname: string;
port: number;
}
let config: HostProperty[] = [{
hostname: "localhost",
port: 3567 // default port
}];
For more info on the config object, click here
API Reference
Initsupertokens.init(config);
supertokens.init(config);
Example
const supertokens = require("supertokens-node");
let config = [{
hostname: "localhost",
port: 3567 // default port
}];
supertokens.init(config);
import * as supertokens from "supertokens-node";
interface HostProperty {
hostname: string;
port: number;
}
let config: HostProperty[] = [{
hostname: "localhost",
port: 3567 // default port
}];
supertokens.init(config);