#nextjs prisma vercel

1 messages · Page 1 of 1 (latest)

vast valleyBOT
#

Hi @terse nova. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The reason you can access your API with the deployed URL without explicitly setting environment variables might be due to the default behavior of Next.js and Vercel. When deploying your Next.js application to Vercel, environment variables can be configured in the Project Settings. If you've configured Development Environment Variables, you can pull them into a .env.local for usage on your local machine using the command vercel env pull .env.local (source (https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables)).

However, it's important to note that for security reasons, non-NEXT_PUBLIC_ environment variables are only available in the Node.js environment, meaning they aren't accessible to the browser. If you need to make the value of an environment variable accessible in the browser, you have to prefix the variable with NEXT_PUBLIC_ (source (https://nextjs.org/docs/app/building-your-application/configuring/environment-variables)).

For Prisma, the template comes pre-populated with the necessary Prisma schema for the app. If you have already cloned and deployed the template, the build script automatically runs prisma db push for you (source (https://vercel.com/guides/nextjs-multi-tenant-application)).

Remember to always secure your environment variables and not expose sensitive data. If you need to add environment variables for your production deployment, you can do so in the Vercel dashboard (source (https://vercel.com/guides/nextjs-prisma-postgres)).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: