Configure app extensions
When you generate an app extension, a TOML configuration file named shopify.extension.toml is automatically generated in your app's extension directory.
Some extension types use different TOML structures and are documented in other topics:
Anchor to How it worksHow it works
Shopify CLI builds and serves app extensions using information defined in a TOML file named shopify.extension.toml. The TOML file is located in a directory within the extensions/ directory of your app project.
The following example shows a shopify.extension.toml file that contains configuration settings for a checkout UI extension.
shopify.extension.toml
Anchor to Extension typesExtension types
Some extensions require specific configurations. To accommodate this, Shopify CLI groups extensions into different types in the TOML file:
| Extension | type value in the TOML file | --template flag value in the generate command |
|---|---|---|
| Admin action | ui_extension | admin_action |
| Admin block | ui_extension | admin_block |
| Customer Account UI | ui_extension | customer_account_ui |
| Checkout UI | ui_extension | checkout_ui |
| Editor extension collection | editor_extension_collection | editor_extension_collection |
| Product configuration | ui_extension | product_configuration |
| Shopify Flow action | flow_action | flow_action |
| Shopify Flow template | flow_template | flow_template |
| Shopify Flow trigger | flow_trigger | flow_trigger |
| POS UI | ui_extension | pos_ui |
| Functions | function | Varies by Functions API |
Anchor to TargetsTargets
A target is an identifier in shopify.extension.toml that specifies where you're injecting code into Shopify APIs, or other parts of the Shopify platform.
Each target is composed of three to four namespaces. The name begins with a broad Shopify context and ends with the behavior of the extensible element. For example, a checkout UI extension that renders a shipping address form has a target named purchase.checkout.delivery-address.render-before:
purchase: The broad Shopify context.checkout: The targeted page.delivery-address: The element that the extension will be positioned near.render-before: An action verb that describes the behavior of the extensible element.
Anchor to Supported targetsSupported targets
The following table provides links to documentation on the supported targets associated with each app extension type.
| Extension type | Documentation on supported targets |
|---|---|
| Admin UI | Admin UI targets |
| Checkout UI | Checkout UI targets |
| Customer Account UI | Customer Account UI targets |
| POS UI | POS UI targets |
| Product configuration | Product configuration app extensions use the admin.product-details.configuration.render or admin.product-variant-details.configuration.render target. |
| Functions | Functions targets |
Anchor to Common propertiesCommon properties
This section describes the configuration settings in shopify.extension.toml that are common to Checkout UI, Admin UI, product configuration, Shopify Flow triggers, Shopify Flow actions, and Shopify Flow templates extensions.
POS UI extensions only support the required properties listed in the table.
POS UI extensions only support the required properties listed in the table.
| Property | Description |
|---|---|
api_versionrequired | The version of the API that's being used for the extension. If provided in the [[extensions]] array, then the specified API version is used instead of the root level api_version. |
[[extensions]]required | The name of the array that contains all extensions listed in the TOML file. Contains the following properties:
|
[settings]optional | The name of the array that defines settings that a merchant can set values for. If provided in the [[extensions]] array, then the specified settings are used instead of the root level settings. |
[[settings.fields]]optional | The name of the array that contains the settings fields. |
[[extensions.targeting]]required | The name of the array that contains a target and path to the related extension code. Contains the following required properties:
|
Anchor to Settings fieldsSettings fields
Settings let merchants customize your extension from the editor. All setting inputs are optional unless marked as required — code your extension so it still works if the merchant hasn't set a value.
Each field in [[settings.fields]] accepts the following properties:
key: The identifier for the setting. The configured value is exposed under this key at runtime.type: The setting type. Determines what input the merchant sees and how the value is validated.name: The merchant-facing display name for the setting.description: Help text displayed to the merchant in the editor.validations: Constraints on the input. See validation options.
Anchor to Supported setting typesSupported setting types
The following setting types apply to checkout UI extensions and customer account UI extensions. Other extension types may support additional types.
The setting type determines the type of information that the setting can store. The setting types have built-in validation on the setting input.
| Type | Description | Example value |
|---|---|---|
boolean | A true or false value. | true |
date | A date in ISO 8601 format without a presumed time zone. | 2022-02-02 |
date_time | A date and time in ISO 8601 format without a presumed time zone. | 2022-01-01T12:30:00 |
single_line_text_field | A single line string. | Canada |
multi_line_text_field | A multi-line string. | Canada |
number_integer | A whole number in the range of +/-9,007,199,254,740,991. | 10 |
number_decimal | A number with decimal places in the range of +/-9,999,999,999,999.999999999. | 10.4 |
variant_reference | A globally-unique identifier (GID) for a product variant. | gid://shopify/ProductVariant/1 |
Anchor to Validation optionsValidation options
Each setting can include validation options. Validation options enable you to apply additional constraints to the data that a setting can store, such as a minimum or maximum value, or a regular expression. The setting's type determines the available validation options.
You can include a validation option for a setting using the validation name and a corresponding value. The appropriate value depends on the setting type to which the validation applies.
| Validation option | Description | Supported types | Example |
|---|---|---|---|
| Minimum length | The minimum length of a text value. | single_line_text_field, multi_line_text_field | name = "min" value = "8" |
| Maximum length | The maximum length of a text value. | single_line_text_field, multi_line_text_field | name = "max" value = "25" |
| Regular expression | A regular expression. Shopify supports RE2. | single_line_text_field, multi_line_text_field | name = "regex" value = "(@)(.+)$" |
| Choices | A list of up to 128 predefined options that limits the values allowed for the setting. | single_line_text_field | name = "choices" value = '["red", "green", "blue"]' |
| Minimum date | The minimum date in ISO 8601 format. | date | name = "min" value = "2022-01-01" |
| Maximum date | The maximum date in ISO 8601 format. | date | name = "max" value = "2022-03-03" |
| Minimum datetime | The minimum date and time in ISO 8601 format. | date_time | name = "min" value = "2022-01-01T00:00:00" |
| Maximum datetime | The maximum date and time in ISO 8601 format. | date_time | name = "max" value = "2022-03-03T00:00:00" |
| Minimum integer | The minimum value of an integer. | number_integer | name = "min" value = "0" |
| Maximum integer | The maximum value of an integer. | number_integer | name = "max" value = "100" |
| Minimum decimal | The minimum value of a decimal number. | number_decimal | name = "min" value = "0.5" |
| Maximum decimal | The maximum value of a decimal number. | number_decimal | name = "max" value = "99.99" |
| Maximum precision | The maximum number of decimal places to store for a decimal number. | number_decimal | name = "max_precision" value = "2" |
Anchor to Extension-specific propertiesExtension-specific properties
This section describes the configuration settings in shopify.extension.toml that are specific to the following extensions:
- Checkout UI extensions
- Customer Account UI extensions
- POS UI extensions
- Editor extension collection
- Admin UI extensions
- Product configuration extensions
- Shopify Flow actions
- Shopify Flow triggers
- Shopify Flow templates
Anchor to Checkout UI extensionsCheckout UI extensions
The following example TOML file contains configuration settings for a checkout UI extension:
shopify.extension.toml
The following table describes the properties in the TOML file that are specific to checkout UI extensions:
| Property | Description |
|---|---|
[extensions.capabilities]optional | The name of the array that contains the checkout UI extension's capabilities:
|
[extensions.metafields]optional | An array that sets the default for each [[extensions.targeting.metafields]], if [[extensions.targeting.metafields]] isn't specified. |
[[extensions.targeting.metafields]]optional | The metafields that your extension target needs to read:
key and namespace pairs in the configuration file. When the extension is executed, Shopify looks for the metafields in each resource and returns their contents. |
[[extensions.targeting.default_placement]]optional | Defines which location of a block extension target an extension is placed in when added. After adding the extension, the merchant can move it to other locations. Value must be a checkout [block extension target](/docs/apps/build/checkout/test-checkout-ui-extensions#block-extension targets). |
Anchor to Customer account UI extensionsCustomer account UI extensions
The following example TOML files contain configuration settings for a static and a full page extension. The properties in the TOML files are similar to checkout UI extensions:
shopify.extension.toml
The following table describes the properties in the TOML file that are specific to customer account UI extensions:
| Property | Description |
|---|---|
[extensions.capabilities]optional | The name of the array that contains the customer account UI extension's capabilities:
|
[extensions.metafields]optional | An array that sets the default for each [[extensions.targeting.metafields]], if [[extensions.targeting.metafields]] isn't specified. |
[[extensions.targeting.metafields]]optional | The metafields that your extension target needs to read:
key and namespace pairs in the configuration file. When the extension is executed, Shopify looks for the metafields in each resource and returns their contents. |
[[extensions.targeting.default_placement]]optional | Defines which location of a block extension target an extension is placed in when added. After adding the extension, the merchant can move it to other locations. Value must be one of the customer account placements for the block extension target. |
Anchor to Supported resource metafield typesSupported resource metafield types
Supported resource metafield types for customer account UI extensions include:
| Resource | Description |
|---|---|
cart | The cart associated with the checkout. |
customer | The customer associated with the order. |
order | The order being viewed. |
company | The company for B2B orders. |
companyLocation | The company's location for B2B orders. |
product | The products in the order. |
shop | The shop associated with the order. |
variant | The product variants in the order. |
Anchor to App-owned metafieldsApp-owned metafields
App-owned metafields are supported. You can use app-owned metafields when your app needs to control the data and visibility of the metafield.
Your extension can access app-owned metafields that are requested in its TOML using the $app format. Your extension can only access app-owned metafields that belong to its parent app.
When accessing app-owned metafields, you must use the $app format. The fully qualified reserved namespace format such as app--{your-app-id}[--{optional-namespace}] is not supported.
When accessing app-owned metafields, you must use the $app format. The fully qualified reserved namespace format such as app--{your-app-id}[--{optional-namespace}] is not supported.
Anchor to POS UI extensionsPOS UI extensions
The following example TOML file contains configuration settings for a POS UI extension configured to run offline:
shopify.extension.toml
The following table describes the properties in the TOML file that are specific to POS UI extensions:
| Property | Description |
|---|---|
[extensions.supported_features]optional | Declares additional features for your extension. Contains the following property:
|
Anchor to Editor extension collectionEditor extension collection
The following example TOML files contain configuration settings for an editor extension collection:
shopify.extension.toml
The following table describes the properties in the TOML file that are specific to editor extension collections:
| Property | Required? | Description |
|---|---|---|
[extensions.includes] | Yes | An array that sets the supported extensions that belong in the editor extension collection. Limitations:
|
Anchor to Admin UI extensionsAdmin UI extensions
The following example TOML files contain configuration settings for an action and a block extension. The properties in the TOML files are similar to checkout UI extensions:
shopify.extension.toml
shopify.extension.toml
Anchor to Product configuration extensionsProduct configuration extensions
The following example TOML file contains configuration settings for a product configuration extension. The properties in the TOML file are similar to a checkout UI extension:
shopify.extension.toml
Anchor to Shopify Flow actionsShopify Flow actions
The following example TOML file contains configuration settings for a Shopify Flow action:
shopify.extension.toml
The following table describes the properties in the TOML file that are specific to a Shopify Flow action:
| Property | Description |
|---|---|
[[extensions]]required | The name of the array that contains all extensions listed in the TOML file. Contains the following properties:
|
[[settings.fields]] required | The name of the array that contains the settings fields. Contains the following property:
|
Anchor to Shopify Flow triggersShopify Flow triggers
The following example TOML file contains configuration settings for a Shopify Flow trigger. The properties in the TOML file are similar to a Shopify Flow action:
shopify.extension.toml
Anchor to Shopify Flow templatesShopify Flow templates
The following example TOML file contains configuration settings for a Shopify Flow template.
shopify.extension.toml
The following table describes the properties in the TOML file that are specific to a Shopify Flow template:
| Property | Description |
|---|---|
[extensions.template]required | Settings related to the template. Contains the following properties:
|
Anchor to Differences in TOML file namesDifferences in TOML file names
TOML file names can differ, depending on when you generated an extension:
-
If you generated an extension before July 26, 2023, then your TOML file maps to one of the following names:
- Checkout UI:
shopify.ui.extension.toml - Bundles UI extension:
shopify.ui.extension.toml(maps to a product configuration extension) - Post-purchase UI:
shopify.ui.extension.toml - Product subscription:
shopify.ui.extension.toml - Web pixel:
shopify.ui.extension.toml - Shopify POS UI:
shopify.ui.extension.toml - Theme app extensions:
shopify.theme.extension.toml
- Checkout UI:
-
If you generated an extension after July 26, 2023, then the TOML file is named
shopify.extension.toml.