Hire Lovable Xperts
Glossary

Environment variables

Environment variables are key–value settings supplied to an application at runtime rather than hard-coded into its source. They are the standard way to keep secrets — API keys, database URLs, tokens — out of the codebase and to vary configuration between local, staging, and production environments.

Also known as: env vars · secrets

A critical distinction in front-end frameworks is public vs. private variables: anything prefixed for client exposure (for example NEXT_PUBLIC_ in Next.js or VITE_ in Vite) is bundled into the browser and is NOT secret. True secrets like a service_role key must stay server-only and never carry a public prefix.

When you move a Lovable app to your own host, environment variables are also the most common thing left behind, which is why a deploy that worked in Lovable can break immediately on Vercel or Netlify. Common mistake: putting a true secret behind a public prefix like NEXT_PUBLIC_ or VITE_ so it gets bundled into the browser — public-prefixed values are visible to every visitor and must never hold a service_role key or any other secret.

← Back to the glossary

Stuck on the thing this term describes? Talk to a senior engineer.

Book a free 30-minute audit call. We'll diagnose what's wrong and tell you exactly what it costs to fix.

Book a free audit call