im trying to get the logged in users email on the backend:
const ThirdParty = require("supertokens-node/recipe/thirdparty");
async function generateNewInvoice(req, res, next) {
const userId = session.userId;
let userInfo = await ThirdParty.getUserById(userId);
But it dies at the ThirdParty.getByUserId() method:
Uncaught Error Error: Initialisation not done. Did you forget to call the SuperTokens.init function.
Im following this guide basically exactly. What am I doing wrong?
https://supertokens.com/docs/thirdparty/common-customizations/get-user-info#using-getuserbyid