Hi, I am using Next.js pages router and have init...
# support-questions-legacy
b
Hi, I am using Next.js pages router and have initialised Supertoken in
_app.tsx
by using
Copy code
if (typeof window !== 'undefined') {
  initAuth();
}
before
export default function App...
Inside
initAuth()
, I call the
SuperTokens.init
function. This all seems to work but we are using a build once deploy many approach and when I try to use env variables at runtime, they are not available at that level. Any insight on this?
r
hey @bteres
i think you have to add the env vars during he build process itself for nextjs to pick it up. Im not too sure how nextjs env vars work, but this may be a better question to ask the nextjs community
b
Thanks. I think I have made a plan. Is that the best place to have the
SperTokens.init
function?
r
yea