> 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 the Secrets Manager

## Article: About the Secrets Manager

## Article Link: https://dev.wix.com/docs/studio-two/code-your-site/developer-environment/secrets/about-the-secrets-manager.md

## Article Content:

# About the Secrets Manager

The Secrets Manager lets you securely store and manage secrets for use in your site's code. A secret is any sensitive piece of information, such as an API key, OAuth token, or environment configuration value.

[Add secrets](https://dev.wix.com/docs/studio-two/code-your-site/developer-environment/secrets/manage-secrets-in-the-secrets-manager.md#step-2--manage-your-secrets) in the Secrets Manager by assigning each secret a [unique name](#secret-fields). You then read the secret in backend code, such as an HTTP endpoint, as an environment variable, with `process.env.<SECRET_NAME>`.

## How code reads secrets

In backend code, such as an HTTP endpoint, read a secret with `process.env` and the secret's name:

```ts
const apiKey = process.env.SUPPLIER_API_KEY;
```

Keep these points in mind:

- **Frontend code:** Frontend code can't read secrets. To use a secret on behalf of frontend code, read it in an [HTTP endpoint](https://dev.wix.com/docs/studio-two/code-your-site/build-a-custom-backend/http-endpoints/about-http-endpoints.md) and call the endpoint. Check who is calling the endpoint first, and don't return the secret's value.
- **Don't use `@wix/secrets`:** The `@wix/secrets` package can't read secrets you add in the Secrets Manager. Its `getSecretValue()` method returns `SECRET_NOT_FOUND`.

For the steps, see [Manage Secrets in the Secrets Manager](https://dev.wix.com/docs/studio-two/code-your-site/developer-environment/secrets/manage-secrets-in-the-secrets-manager.md#step-3--read-a-secret-in-your-backend-code).

## Enhanced security

Hardcoding secrets directly into your code creates security risks that can lead to data breaches and unauthorized access.

Here's how the Secrets Manager improves your site's security:

- **Code sharing**: Collaborating on code or managing it in a public repository increases the risk of accidentally leaking secrets.
- **Code reusability**: Because code is often reused, hardcoded secrets can be copied and exposed unintentionally.

## Secret fields

| Field name | Field description | Requirements | Required |
|---|---|---|---|
| <a id='name-field'></a> Name | ID you assign to the secret. Read it in backend code, such as an HTTP endpoint, with `process.env.<SECRET_NAME>`. | <ul><li>64 character maximum.</li><li>Only Latin letters, numbers, and the underscore character `_`. No spaces, hyphens, or other special characters.</li><li>Must begin with a letter or an underscore.</li></ul> | Yes |
| Value | Value of the secret. | <ul><li>10,000 character maximum.</li></ul> | Yes |

## Roles and permissions

Only site collaborators with the role **Admin (Co-Owner)** or **Website Manager** can access the Secrets Manager. Learn more about [roles and permissions](https://support.wix.com/en/article/roles-permissions-overview).

<blockquote class="important">

**Important:**
- [Transferring a site](https://support.wix.com/en/article/transferring-a-free-site-to-another-wix-account) transfers secrets to the new owner.
- [Duplicating a site](https://support.wix.com/en/article/duplicating-your-site-1472847?tabs=Dashboard) **does not** transfer secrets to the duplicate site.

</blockquote>

## See also

- [Manage Secrets in the Secrets Manager](https://dev.wix.com/docs/studio-two/code-your-site/developer-environment/secrets/manage-secrets-in-the-secrets-manager.md)
- [About HTTP Endpoints](https://dev.wix.com/docs/studio-two/code-your-site/build-a-custom-backend/http-endpoints/about-http-endpoints.md)