Search code examples
shopifyshopify-app

How to add script to the front side of the shopify app


As i am new to shopify app i created an app and installed over a store with script tag having read and write permission . How can i dynamically add the javascript to the front side of shopify app.


Solution

  • Use the Script Tag API to create the javascript you want to load dynamically.

    # POST /admin/script_tags.json
    
    {
      "script_tag": {
        "event": "onload",
        "src": "https://djavaskripped.org/fancy.js"
      }
    }
    

    Documentation: Link