Skip to main content

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.

Note

This guide describes the TOML file structure that only applies to checkout UI, admin UI, customer account UI, product configuration, Shopify Flow triggers, Shopify Flow actions, and Shopify Flow templates extensions. The TOML file structure for other extensions is described in the following topics:


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

api_version = "2023-04"

[[extensions]]
name = "My UI extension"
description = "A UI extension"
handle = "my-ui-extension"
type = "ui_extension"

[extensions.capabilities]
api_access = true
block_progress = true
network_access = true

[[extensions.targeting]]
module = "./src/CheckoutDynamicRender.js"
target = "purchase.checkout.block.render"

[[extensions.targeting.metafields]]
key = "my-key"
namespace = "my-namespace"

[settings]
[[settings.fields]]
key = "banner_title"
type = "single_line_text_field"
name = "Banner title"
description = "Enter a title for the banner"

Some extensions require specific configurations. To accommodate this, Shopify CLI groups extensions into different types in the TOML file:

Note

The --template flag value in the command to generate Shopify Functions extensions depends on the Functions API that you're using.


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.

The following table provides links to documentation on the supported targets associated with each app extension type.

Note

Shopify Flow triggers and actions don't support configurable targets.

Extension typeDocumentation on supported targets
Checkout UICheckout UI targets
Customer account UICustomer Account UI targets
Admin UIAdmin UI targets
Product configurationProduct configuration app extensions use the admin.product-details.configuration.render or admin.product-variant-details.configuration.render target.

This section describes the configuration settings in shopify.extension.toml that are common to checkout UI extensions, admin UI, product configuration, Shopify Flow triggers, Shopify Flow actions, and Shopify Flow templates extensions.

PropertyDescription
api_version
required
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:
  • name:required The merchant-facing name of the extension. After you generate an extension, you're prompted to provide a name for your extension.
    The name property is translatable if it starts with a t: and uses a key defined in your translation data. For example, you might have a t:name key that matches a translation key called name. Learn more about localization.
    Limitations:
    • Supports any characters. Shopify Flow actions and Shopify Flow triggers extensions can only include alphanumeric characters and spaces.
    • 5 characters minimum
    • 30 characters maximum
  • description:required The merchant-facing description of the extension.
    The description property is translatable if it starts with a t: and uses a key defined in your translation data. For example, t:description and you have a matching translation key called description. Learn more about localization.
  • handle:required The unique internal identifier for the extension.
    After you create a draft version of the extension, or deploy an extension, you can't change the handle value.
    If not specified, the handle value is automatically populated using a transformed name value that removes any unsupported characters. For example, if you enter google maps as the extension name, then Shopify populates the handle value as google-maps.
    Limitations:
    • Allowed characters: a-z, A-Z, 0-9, -
    • 100 characters maximum
    • Must be unique within the app
  • type:required The extension type. For more information, refer to Extension types.
[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:
  • target:required An identifier that specifies where you're injecting code into Shopify APIs, or other parts of the Shopify platform. For more information, refer to Targets.
  • module:required The file that contains the extension code.

Anchor to Extension-specific propertiesExtension-specific properties

This section describes the configuration settings in shopify.extension.toml that are specific to the following extensions:

Anchor to Checkout UI extensionsCheckout UI extensions

The following example TOML file contains configuration settings for a checkout UI extension:

shopify.extension.toml

api_version = "2023-04"

[[extensions]]
name = "My UI extension"
description = "A UI extension"
handle = "my-ui-extension"
type = "ui_extension"

[extensions.capabilities]
api_access = true
block_progress = true
network_access = true

[[extensions.targeting]]
module = "./src/CheckoutDynamicRender.js"
target = "purchase.checkout.block.render"
default_placement = "WALLETS1"

[[extensions.targeting.metafields]]
key = "my-key"
namespace = "my-namespace"

[settings]
[[settings.fields]]
key = "banner_title"
type = "single_line_text_field"
name = "Banner title"
description = "Enter a title for the banner"

The following table describes the properties in the TOML file that are specific to checkout UI extensions:

PropertyDescription
[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:optional The name for the metafield.
  • namespace:optional A container for a group of metafields. Grouping metafields within a namespace prevents your metafields from conflicting with other metafields with the same key name.
You can specify up to five 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

api_version = "2023-07"

[[extensions]]
type = "ui_extension"
name = "customer-account-ui"
handle = "customer-account-ui"

[[extensions.targeting]]
module = "./src/CustomerAccountOrderIndexExtension.tsx"
target = "customer-account.order-index.block.render"
default_placement = "ORDER_INDEX"

[[extensions.targeting]]
module = "./src/CustomerAccountExtensionFullPage.tsx"
target = "customer-account.page.render"

The following table describes the properties in the TOML file that are specific to customer account UI extensions:

PropertyDescription
[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: The name for the metafield.
  • namespace: A container for a group of metafields. Grouping metafields within a namespace prevents your metafields from conflicting with other metafields with the same key name.
You can specify up to five 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 Editor extension collectionEditor extension collection

The following example TOML files contain configuration settings for an editor extension collection:

shopify.extension.toml

[[extensions]]
name = "t:collection_name"
type = "editor_extension_collection"
handle = "editor-extension-collection"
includes=["customer-account-ui", "checkout-ui-extension"]

The following table describes the properties in the TOML file that are specific to editor extension collections:

PropertyRequired?Description
[extensions.includes]YesAn array that sets the supported extensions that belong in the editor extension collection.

Limitations:
  • Currently, can only contain customer account UI and checkout UI extensions.
  • Must contain two or more 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

api_version = "2023-04"

[[extensions]]
name = "My feature"
handle = "action-extension"
type = "ui_extension"

[[extensions.targeting]]
module = "actionExtension.jsx"
target = "admin.product.item.action.render"

shopify.extension.toml

api_version = "2023-04"

[[extensions]]
name = "My block extension"
handle = "block-extension"
type = "ui_extension"

[[extensions.targeting]]
module = "blockExtension.jsx"
target = "admin.product.item.block.render"

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

api_version = "2023-07"

[[extensions]]
name = "My product config extension"
handle = "my-product-config-extension"
type = "ui_extension"

[[extensions.targeting]]
module = "./src/ProductDetailsConfigurationExtension.tsx"
target = "admin.product-details.configuration.render"

[[extensions.targeting]]
module = "./src/ProductVariantDetailsConfigurationExtension.tsx"
target = "admin.product-variant-details.configuration.render"

Anchor to Shopify Flow actionsShopify Flow actions

The following example TOML file contains configuration settings for a Shopify Flow action:

shopify.extension.toml

[[extensions]]
name = "Send email action"
description = "Send an email to a customer."
handle = "send-email-action"
type = "flow_action"
runtime_url = "https://runtime-endpoint.com"
schema = "./schema.graphql"
return_type_ref = "EmailDelivered"
validation_url = "https://validation-url"
config_page_url = "https://url.com/config"
config_page_preview_url = "https://url.com/config/preview"

[settings]

[[settings.fields]]
description = "The email address to send to"
key = "email_address"
name = "Email address"
type = "single_line_text_field"
required = true

[[settings.fields]]
description = "The subject of the email"
key = "subject"
name = "Subject"
type = "single_line_text_field"
required = true

[[settings.fields]]
description = "The body of the email"
key = "body"
name = "Body"
type = "multi_line_text_field"
required = true

The following table describes the properties in the TOML file that are specific to a Shopify Flow action:

PropertyDescription
[[extensions]]
required
The name of the array that contains all extensions listed in the TOML file. Contains the following properties:
  • runtime_url:required The endpoint where Flow sends your action's payload when your step is being executed at runtime. The payload contains data that you can use to execute the action in your app.
  • validation_url:optional An endpoint that validates the contents of custom properties in an action payload when an action is saved. This endpoint is only required if you want to use a custom configuration page.
  • schema:optional A relative path to a GraphQL schema definition file that contains custom types that you can use as part of your action. Only required if return_type_ref is also present.
  • return_type_ref:optional The name of the type to be returned by the action. This type must be present in the referenced schema file. Only required if schema is also present.
  • config_page_url:optional A route that renders your custom configuration page.
  • config_page_preview_url:optional An endpoint that provides data about your custom configuration page to display in the automation tool. This endpoint is only required if you want to use a custom configuration page.
[[settings.fields]]
required
The name of the array that contains the settings fields. Contains the following property:
  • required:required Specifies whether a field is required (true) or optional (false).

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

[[extensions]]
name = "Shopify Email sent"
description = "Triggered when an email is sent from Shopify"
handle = "shopify-email-sent"
type = "flow_trigger"

[settings]

[[settings.fields]]
description = "The customer who received the email."
key = "customer_id"
name = "Customer ID"
type = "customer_reference"

[[settings.fields]]
description = "The marketing campaign ID."
key = "campaign_id"
name = "Campaign ID"
type = "single_line_text_field"

Anchor to Shopify Flow templatesShopify Flow templates

The following example TOML file contains configuration settings for a Shopify Flow template.

shopify.extension.toml

[[extensions]]
name = "t:name"
type = "flow_template"
handle = "example-name"
description = "t:description"

[extensions.template]

categories = ["orders", "risk"]

module = "./template.flow"

require_app = false

discoverable = true

enabled = true

The following table describes the properties in the TOML file that are specific to a Shopify Flow template:

PropertyDescription
[extensions.template]
required
Settings related to the template. Contains the following properties:
  • categories:required The categories that best describe the function of your template. Must be an array containing only strings of valid categories. Must choose at least one category. Max 2 recommended. Valid categories are: buyer_experience, customers, inventory_and_merch, loyalty, orders, promotions, risk, fulfillment, b2b, payment_reminders, custom_data, and error_monitoring.
  • module:required The file path of the template workflow in the extension's folder.
  • require_app:optional Whether your template is visible only to merchants who have your app installed. Defaults to false if not provided.
  • discoverable:optional Whether your template should be displayed in the template browser. When false, the template is accessible only through a deep link. Defaults to true if not provided.
  • enabled:optional Whether your template should be made available after being approved and released. Defaults to true if not provided.

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
  • If you generated an extension after July 26, 2023, then the TOML file is named shopify.extension.toml.


Was this page helpful?