Skip to main content

Overview

Site variables let you store private values, such as API keys, on a site without shipping them in browser files. These values are:
  • encrypted at rest
  • scoped to a single site
  • never returned in plaintext after saving
  • only manageable by the site owner
This is primarily designed for agent-assisted publishing. If a publish is blocked because SimpleHost detects exposed secrets in client files, the agent can ask the user for permission, move the secret into site variables, and publish a safe version instead.

Endpoints

List Variables

Returns variable names and timestamps only. Secret values are never returned.

Example

Response

Store Variables

Accepts a JSON object where each key is the variable name and each value is the secret to store.

Example

Response

Delete Variable

Example

Response

Naming Rules

  • Use uppercase names such as OPENAI_API_KEY
  • Start with a letter
  • Use only letters, numbers, and underscores
  • Keep names short and descriptive

Security Notes

  • Do not paste stored variable values back into HTML, JS, or JSON files
  • Site variables are meant to be referenced from the secure site proxy, not exposed directly to the browser
  • If a user refuses the secure rewrite flow, the site should not be published with exposed secrets