Read Product Metafields from Store Javascript

Highlighted
Tourist
4 0 0

I am working on a store theme and want to have custom descriptions for product variants, I did this by adding metafields to each product variant, and I plan on reading these metafields and dynamically updating the description when a user clicks on a variant.

 

I see the admin API can read metafields, but I need an access token, which I do not want to store in my themes javascript file.

 

So how can I read the metafields for a product variant and update the html text?

0 Likes