How to use Shopify api.js with registered script via script tag?

New Member
8 0 0

Hello All,

I am creating one App. I have registered one script via script tag for frontend activities.

Now i have flow like when user add items to cart i want to know about that product added cart. Even when item removed,updated i want to know this activity so i can do my some stuff.

I did search and found about api.js.

But i don't know how to use it.

Is this api.js i already added by shopify or not?

If already loaded then how to access events like onItemAdded, onItemAdded in registered scripts?

If not loaded by shopify then how to load this js and use it's functions?

Please help me. i could not found any related detailed information.