All docs pages
Docs

Owner settings

Choices you make on a feature's page, such as email texts or who may sign up, used by the app without a rebuild.

In stackly.json and the CLI it is settings. It has no price of its own; see What features cost.

settings · always included · binding APP_SETTINGS

Choices the owner makes on a feature's page in the Features tab (an email subject, whether sign-up is open, where alerts go, a limit), used by the app without a rebuild.

Use it

  1. Declare each setting in stackly.json "settings", under the feature it belongs to:

    "settings": [
      { "key": "welcome-subject", "feature": "email", "label": "Welcome email subject", "type": "text",
        "default": "Welcome!", "description": "The subject of the email new customers get." }
    ]
    
  2. Read it on the server:

    import { setting } from "#/lib/settings.server";
    
    const subject = setting<string>("welcome-subject") ?? "Welcome!";
    
  • key: lowercase letters, digits and -. feature: a listed feature, or an included one such as settings.
  • type: text, long-text, email, url, number, boolean or choice (with "choices": [...]).
  • Give every setting a safe default. Only when no default can be right (the owner's own address) mark it "required": true with no default. It reads undefined until filled, so the app must skip or hide that part.
  • allSettings() returns every value.

Limits

At most 100 settings. A saved value reaches the next request.

Don't

Never put a secret in a setting: settings are shown in plain text. Never hard-code something the owner should change.

Locally

stackly dev uses the defaults.

All app features