> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: About Environment Variables in the CLI

## Article: About Environment Variables in the CLI

## Article Link: https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/project-development/environment-variables/about-environment-variables-in-the-cli.md

## Article Content:

# About Environment Variables in the CLI


Environment variables allow you to store configuration values and secrets outside of your code, making your apps more secure and portable. In a Wix CLI app, backend code reads environment variables from `process.env`. Frontend code, such as dashboard pages and site widgets, can't read the environment variables you define.

This article explains where environment variables are stored in Wix CLI projects and which code can read them.

## Where environment variables are stored

An environment variable's storage location determines where its value is available.

| Storage location | How you set it | Where the value is available |
|------------------|----------------|------------------------------|
| Wix servers | The [`wix app env set`](https://dev.wix.com/docs/wix-cli/cli-for-apps/command-reference/project-commands/env.md#set) command. | Deployed code in preview and release builds. Local development after you run [`wix app env pull`](https://dev.wix.com/docs/wix-cli/cli-for-apps/command-reference/project-commands/env.md#pull). |
| `.env.local` file only | Add the variable to the `.env.local` file in your project root. | Local development only. The value doesn't reach preview or production builds. |

### Variables on Wix servers

Store every value that your deployed code needs on Wix servers, including sensitive values such as API keys:

- Variables you set with `wix app env set` are stored on Wix servers and shared with your project's collaborators.
- Deployed code in preview and release builds reads these variables from `process.env`.
- To use the variables in local development, run `wix app env pull`. The command merges the variables from Wix servers into your `.env.local` file.

### Variables in .env.local

A variable that you add only to `.env.local` stays on your computer. Use `.env.local` alone only for values that you need in local development and not in deployed code.

The project's `.gitignore` file excludes `.env.local`, so pulled values aren't committed to your repository. Keep `.env.local` out of source control.

`.env.local` also contains `WIX_CLIENT_*` variables, which the Wix CLI manages. Don't edit them.

## Which code can read environment variables

Backend code, such as HTTP endpoints, event extensions, and service plugins, reads environment variables from `process.env`.

Frontend code, such as dashboard pages and site widgets, can't read the environment variables you define. If frontend code needs a non-sensitive configuration value, have it call an [HTTP endpoint](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/supported-extensions/backend/http-endpoints/about-http-endpoints.md) that returns the value. Don't return sensitive values to frontend code.

## See also

- [Manage Environment Variables](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/project-development/environment-variables/manage-environment-variables-in-the-cli.md)