Skip to main content

Settings API

The Settings API lets you read the values that merchants configure for your extension in the checkout and accounts editor. Use this API to make your extension customizable. Merchants define values like banner titles, feature toggles, or thresholds, and your extension reads them at runtime. Learn how to define settings in your configuration.

  • Display merchant-customized content: Read settings like banner titles, welcome messages, or promotional text that merchants configure without needing to update your extension's code.
  • Toggle extension features: Use boolean settings to let merchants enable or disable specific behaviors in your extension, such as showing a loyalty badge or hiding certain sections.
  • Configure thresholds and limits: Let merchants define numeric values like minimum order amounts for displaying a message, or the number of items to show in a list.
Support
Targets (24)

The shopify global object provides access to merchant-configured settings for customer account extensions. Access the following properties on shopify to read the values that merchants define for your extension.

Anchor to settings
settings
<>
required

Merchant-defined configuration values for your extension, as specified in the settings definition of your shopify.extension.toml file. Settings update in real time as merchants edit them in the extension editor. The value is empty until a merchant sets it.


  • Provide sensible defaults: Always use a fallback value when reading settings with shopify.settings.value in case the merchant hasn't configured a value yet.
  • Keep settings simple: Define only the settings that merchants genuinely need to customize. Too many settings can overwhelm merchants in the checkout and accounts editor.
  • Use descriptive names and descriptions: Give each setting a clear name and description in your TOML file so merchants understand what each field controls.
  • Validate setting values: Use the validations property in your TOML configuration to enforce constraints like minimum and maximum lengths or allowed values.

  • Settings are read-only in your extension. You can't programmatically update setting values. Merchants must change them in the checkout and accounts editor.
  • Setting values are only available after the extension has loaded. Accessing shopify.settings.value before initialization returns undefined.
  • Settings don't support complex data types like arrays or nested objects. Refer to supported setting types for the full list of available types.

Was this page helpful?