Other integration methods
You can use the ScriptTag
or Asset
resource alongside theme app extensions to provide specific types of support for vintage themes.
If you're creating a new app that integrates with a theme, and you're submitting the app to the Shopify App Store, then you need to use theme app extensions. However, if you offer your app functionality as an app block, which isn't compatible with vintage themes, then you still might need to use the Asset or ScriptTag resource in addition to theme app extensions.
You don't need to update apps that are already published on the Shopify App Store to use theme app extensions. However, all of the apps in the Shopify App Store need to be compatible with Online Store 2.0 themes, and you might want to use theme app extensions to achieve this.
The Asset
resource
Anchor link to section titled "The Asset resource"If your app needs to modify the code of vintage themes, then you should:
- Use the
Asset
REST Admin API resource to inject the app snippets into the theme's Liquid files. - Include detailed instructions for the merchant on how to add and remove the code.
Assets are the files used to create an online store's theme. You can use the Asset
REST Admin API resource to add, change, or remove asset files from a shop's theme. You need to provide merchants who use the app with detailed instructions on how to add and remove any code your app injects into the theme with the Asset
resource.
You can do the following with the Asset
resource:
- Retrieve an asset or a list of assets for a theme
- Create or update an asset for a theme
- Delete an asset from a theme
To get started, take a look at the Asset
resource.
The ScriptTag
resource
Anchor link to section titled "The ScriptTag resource"If your app adds app blocks, which aren't compatible with vintage themes, then you can use the ScriptTag
REST Admin API or GraphQL Admin API resource as an alternate installation path for the functionality introduced by the app block. If you're submitting a new app to the Shopify App Store, then you still need to provide app blocks for Online Store 2.0 themes. Learn how to verify support for app blocks.
A script tag represents some JavaScript code running on a remote server. You can use the ScriptTag
resource to load the JavaScript from a remote server into a theme section at the time the section's page is viewed. Script tags are scoped to the app that created them. When an app is uninstalled from a shop, all of the script tags that it created are also removed.
You can do the following with the ScriptTag
resource:
- Add functionality to a shop's page without having to manually edit a theme's template.
- Let merchants uninstall your app without needing to edit a theme's template to revert any changes the app made.
To get started, take a look at the ScriptTag
REST Admin API or GraphQL Admin API resource.