Access app owned metaobject from storefront

In my app I was able to create an app owned metaobject, fetching, creating, and mutating the objects through the app works as intended. However Im having issue accessing the objects on the site via the storefront API. I made sure that the metaobjects are scoped to “MERCHANT_READ_WRITE” and “PUBLIC_READ”, so I should be able to query them via the storefront. The issue may be the type that I am querying, in the admin I can successfully query with type: “$app:banner”, but I’m assuming that I need to supply the app ID when querying from the storefront. I can easily grab the app id that create the app objects, but this doesnt sound scalable for a variety of reasons. I’m not sure if the app id will be the same across merchants for one. So in short:

What is the recommended way to handle accessing app owned metaobjects from the storefront?

Any answers on this?

I think you need to access it though an app block, based off these docs: Use app-data metafieldsLiquid objects

Is that what you’re trying? or did you miss the app block step? I dont think you can access it globally outside that scope, if you were thinking like the shop object.

1 Like

Hi @curzey I’m developing for hydrogen, but your link pointed me in the right direction, thank you!

2 Likes

Oh didnt see that! Great it helped though :blush: