App.extensions() only returning results for published theme

I am trying out the new app.extensions() method for app bridge and it seems to only return the blocks from the published theme. Is this intentional?

Hi @Alex_Moser !

At the moment we’re only supporting the blocks for the published theme. I’ll update the docs to reflect this, thanks for bringing it to my attention.

Can I ask about your use case, so I can understand why you’d need to query for app block status in unpublished themes?

Bashu

Hi!

Our app allows merchants to create blocks that can be inserted throughout the theme. Each block corresponds to a banner that the merchant has created in the app admin via a Banner ID block setting.

We have a theme dropdown in the app admin. When a merchant selects a theme, we update the displayed installation status of the banner(s) accordingly. For banners that have not been added to the theme, we provide an install button that deep links them to main section of the default product template (the most common place we expect merchants to install the block) of the selected theme.

For themes without too many alternate templates (e.g. product.alt.json, collection.alt.json) this works fine. However, since some merchants have 100+ templates, it becomes impractical to fetch and scan all of them without something like app.extensions(). Because of this, we are planning on removing the installation status feature completely.

In an ideal world, we would be able to pass a theme_id parameter to app.extensions().

1 Like