Function settings
When you create a function, the shopify.extension.toml
file is automatically generated in your function extension directory. This guide describes the properties available in the shopify.extension.toml
file.
Anatomy of a function settings file
Anchor link to section titled "Anatomy of a function settings file"The shopify.extension.toml
file contains the extension's settings, which includes the extension name, type, API version, UI paths, build settings, and metafields for query variables.
The following table describes the properties available in the shopify.extension.toml
file:
Property | Required? | Description |
---|---|---|
name |
Yes | The name of the function. |
type |
Yes | The type of extension. |
api_version |
Yes | The version of the Function API. |
ui.enable_create |
No | Refer to configuring creation workflows for function owners. |
ui.paths.create |
No | Refer to create your function merchant interface. |
ui.paths.details |
No | Refer to create your function merchant interface. |
build.command |
Yes | The command to build the function which is invoked by the Shopify CLI build command. |
build.path |
No | The relative path to the function's WebAssembly module. For example, build/my-module.wasm . Defaults to dist/index.wasm . |
build.watch |
No | The relative paths that Shopify CLI should watch when the dev command is invoked. Changes to matched files trigger a build of the function and update it in your application drafts. This setting accepts a single file path or glob pattern, or an array of file paths and glob patterns.For JavaScript and TypeScript functions, this setting defaults to ['src/**/*.js', 'src/**/*.ts'] . For Rust functions, this setting defaults to ['src/**/*.rs'] .Input queries are automatically included in watch paths and don't need to be configured in build.watch . |
input.variables |
No | Refer to use variables in input queries. |
- Learn how to replace hard-coded variables in your function with metafield values.
- Learn how to use variables in input queries with Shopify Functions.