Plugins can expose merchant-configurable settings and keep per-install data. Settings are declared in the manifest; storage collections are declared and indexed there too.
Settings schema
admin.settings is an array of fields:
{
"admin": {
"settings": [
{
"name": "percent",
"label": "Discount percent",
"type": "number",
"required": true,
"min": 1,
"max": 50,
"default": 5
}
]
}
}Supported field types: string, number, boolean, select, and secret.
Limits: at most 50 fields and 32 KiB of settings.
- Names are
snake_case. selectfields declarelabel/valueoptions.secretfields are write-only. They can declareegressHostsfor host-side HTTP header injection.
Secrets
- Secret values are encrypted at rest with AES-256-GCM.
- The admin API never returns a stored secret; it returns a redaction sentinel
and a
secret_configuredflag. - An omitted or sentinel value preserves the stored secret; an empty string clears it.
- A plugin never receives stored plaintext. For outbound calls, the host injects the secret into a declared egress host’s header.
PLUGIN_ENCRYPTION_KEYis optional and falls back to a key derived fromTOKEN_SECRET. During rotation, setPLUGIN_ENCRYPTION_KEY_PREVIOUS.
Storage
Declare collections in the manifest:
{
"storage": {
"loyalty_members": {
"indexes": [["customer_id"]],
"uniqueIndexes": [["customer_id", "store_id"]]
}
}
}- Storage is scoped to the installation.
- The host enforces declared indexes and unique indexes.
- Use
ctx.storage.get/put/delete; do not expect direct database access.
Updating settings
Settings are updated through the Admin API:
PATCH /api/plugins/installs/:id
Content-Type: application/json
{ "settings": { "percent": 10 } }The request is validated against the manifest schema, capped at 32 KiB, and uses the write-only secret rules above.