_di.mitri
12/20/2020, 5:00 AMSuperTokens.init({
supertokens: {
connectionURI: process.env.SUPERTOKENS_URI,
apiKey:process.env.SUPERTOKENS_API_KEY,
},
appInfo: {
appName: "demo",
apiDomain,
apiBasePath,
websiteDomain
},
recipeList: [
Session.init({
faunadbSecret: process.env.FAUNADB_SECRET_KEY,
userCollectionName: "User",
accessFaunadbTokenFromFrontend: true
})
]
});
FE ---
`const websitePort = process.env.APP_PORT || 3000;
const websiteUrl = process.env.NEXT_PUBLIC_APP_URL || `http://localhost:${websitePort}`;
if (typeof window !== 'undefined') {
SuperTokens.init({
appInfo: {
appName: "demo",
apiDomain: websiteUrl,
websiteDomain: websiteUrl,
apiBasePath: "api/auth"
},
recipeList: [
Session.init({
sessionScope: 'localhost'
}),
]
});
}`