Skip to content
Back

Environment Variables in Nuxt - How to Handle?

  • 0
  • Web
  • Cloud
Abhishek
23 Mar, 2026, 10:28

https://appwrite.io/docs/tutorials/nuxt/step-3#environment-variables

In the guide, the environment variables are imported simply as

TypeScript
const url: string = import.meta.env.VITE_APPWRITE_ENDPOINT;
const project: string = import.meta.env.VITE_APPWRITE_PROJECT;

But if I build the app, then these environment variables are just included in the build as raw strings instead of imports.

How do I protect these variables? What variables are sensitive, and what are not?

TL;DR
- Developers are trying to figure out how to handle environment variables in Nuxt projects like project id and appwrite endpoint. - In the guide, the environment variables are imported easily but get included as raw strings in the build. - The concern is to protect sensitive variables like API keys. Non-sensitive variables might be fine to include. - Recommendation: Consider using server-side environment variables or encryption methods for sensitive data.
Abhishek
23 Mar, 2026, 10:28

Environment Variables in Nuxt - How to Handle?

γ€Ž249』ALi πŸ‡¦πŸ‡±πŸ‡ΈπŸ‡©
23 Mar, 2026, 10:39

Project id and appwrite endpoint are not ment to be hidden afaik , as long as you set up the permissions properly on your appwrite console

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more