Should I use an app extension?

Shopify Partner
2 0 1

Hello, we are trying to make a shopify application for our currently live project. Our application generates an embed code (a simple js file) and we expect our users to add it to their sites. For this, I am currently using the script tag api. Do I need to migrate to app extension? In which cases should I use an application extension?

Reply 1 (1)

Shopify Partner
16 0 2

Yea, based on the documentation suggestions creating an extension appears to be the best solution to "cleanly"/safely inject tags based on 2.0 themes. 

be sure to read up on the app-building documentation here:

Inside the theme extensions block folder (within the application project) you will create something like this:

{% schema %}
  "name": "Your Name",
  "target": "body", // THIS IS IMPORTANT
  "stylesheet": "file-name.css",
  "javascript": "file-name.js",
  "settings": []
{% endschema %}