How To Make The ScriptTag Injection Work Using The CLI3.0?

Hello,

I’m building an app, I have a backend, (admin) frontend and I’m now trying to modify the (public store) product page to display data from my app to the website’s visitors.

I started from the NodeJS/express/react boilerplate with the CLI3.0.

From what I’ve understood, I can either make a Theme App Extension but they’re only compatible with Shopify Themes 2.0. I’m therefor trying to do it the old way and inject a JS script in the product page.

I can’t make sense of the ScriptTags documentation, where am I supposed to add the code snippet?

How to make the ScriptTag injection work using the CLI3.0?

This is my first app, any resource recommandation (youtube series, github code examples, and so on) would be greatly appreciated.

Thanks!

Best Regards,,,

Hello @johnbreak

All Shopify stores have an API to manage store Script Tags. If you have the admin access to the shopify store you can open scriptTags endpoint manually.
As example: https://store-name.myshopify.com/admin/api/2022-07/script_tags.json

Shopify custom Apps also can use this endpoint to reading/writing scripts to shop.
If you already have base shopify application template, you can configure logic to make request to the endpoint as post request with defined format.

Documentation about script tags api: https://shopify.dev/api/admin-rest/2022-07/resources/scripttag

The best way is to make request to new script tags during the application installation process.