Next.js Discord

Discord Forum

.env and .env.local confusion

Unanswered
Shayokh posted this in #help-forum
Open in Discord
I just installed Authjs and Prisma into project. Authjs created a .env.local file with AUTH_SECRET and Prisma created .env file containing DATABASE_URL. I have quite a few questions.

1) What's the difference between these 2 files?
2) Should both of these files stay on my project or just one of them?
3) Should I transfer the AUTH_SECRET to .env or vice versa?
4) Which env file should I push to production on vercel?
5) Where can I learn more about env files?

0 Replies