Using NextAuth with DEPLOY_PRIME_URL

Hi @tsg

Functions only use environment variables defined in the UI explicitly.

As functions are built after the main build process, part of the build command (or a postbuild script) could output the required environment variables to a .env file which through the use of dotenv you could then access in the functions.

There is a very long detailed thread on using environment variables on Netlify which go into a lot more detail

1 Like