Preview service connections

Declare the service addresses and credentials editors can supply for a local preview.

Use studio.connections.json beside package.json if the local preview needs an external service. Commit the field definitions. Editors enter the values under Website → Preview connections on their own device. Saving applies the values to the preview process. Use website default clears an override.

{
  "connections": [{
    "id": "catalogue",
    "label": "Gallery catalogue",
    "fields": [
      { "env": "APP_CATALOGUE_URL", "label": "Service address", "kind": "url" },
      { "env": "APP_CATALOGUE_KEY", "label": "Access key", "kind": "secret" }
    ]
  }]
}
KeyValues and effect
connectionsRequired array, up to 20 connections. Without the file, the website declares no connection fields. The file limit is 64 KiB. Unknown keys are rejected.
id, label, descriptionEach connection requires a unique, nonempty ID and a nonempty display label. The optional description explains what the service supplies.
fieldsRequired, nonempty array of inputs for the connection.
fields[].envRequired environment variable name, unique across the file, up to 128 characters. Use uppercase letters, digits, and underscores with prefix APP_, PUBLIC_, VITE_, or NUXT_. Studio reserves NUXT_PORT, NUXT_HOST, and NUXT_ROOT_DIR.
fields[].kindRequired. Use text, url, or secret. A secret requires a server-side name. Public prefixes PUBLIC_, VITE_, and NUXT_PUBLIC_ are rejected for secrets.
fields[].label and fields[].helpRequired nonempty display label and optional help text for the editor.
fields[].requiredOptional boolean, default false. Marks a value the service needs. An editor can leave it empty when the website already supplies it.