Hello Team,
I have a question regarding Theme App Extension deep linking URLs.
When a merchant installs our app, we use a URL like the one below to automatically open the Theme Editor and allow them to add our app block:
https://store.myshopify.com/admin/themes/current/editor?template=product&addAppBlockId=APP_BLOCK_ID/FILE_NAME&target=newAppsSection
This works well for first-time setup.
However, once the merchant has already added the app block, is there any URL that can directly take them to the existing app block inside the Theme Editor instead of showing the “Add App Block” flow again?
Currently, even when I detect that the app block is already added, I still use the same deep link. As a result, if the merchant clicks the button again, they can accidentally add a duplicate app block.
My goal is:
-
Show “Add in Theme Editor” for merchants who have not added the app block yet.
-
Show “Manage in Theme Editor” for merchants who have already added the app block.
-
The “Manage” button should ideally open the existing app block in the Theme Editor rather than prompting the merchant to add a new one.
Is there a recommended way to achieve this?
Thank you.
Hey @Ajay_Rabari one way you can do this is to treat the add and manage flows separately.
For example, once your app has confirmed the block already exists on that template, instead of using the same deeplink, instead link to the relevant theme editor template without addAppBlockId. That gets them back to the right editing context, but does not start the add-block flow again.
Thank you @KyleG-Shopify , However, our app block includes several configurable settings defined in the block schema. Because of this, simply opening the Theme Editor is not sufficient—we would ideally like to bring merchants directly back to the specific app block instance they previously added so they can manage its settings.
Is there currently any way to deep link to an existing app block within the Theme Editor, perhaps using the block ID, extension ID, URL parameters, or any other supported mechanism?
Our goal is to avoid creating duplicate blocks while providing a seamless “Manage in Theme Editor” experience that opens the already-added app block and its settings panel.
I hope that makes sense. Any guidance would be greatly appreciated.
Hey @Ajay_Rabari, I did some more testing on this, and there does appear to be a workable path for opening an existing app block instance rather than starting the addAppBlockId flow again.
In my testing the Theme Editor accepts a URL using the existing section and block IDs, in this format:
https://<store>.myshopify.com/admin/themes/<theme_id>/editor?appEmbed=<api_key>/<handle>§ion=<section_id>&block=<block_id>
Thesection_id and block_id come from the theme JSON for the template where the app block was added.
I wasn’t able to find this specific flow documented in our developer docs, so I’d treat this as something to test carefully in your own app rather than as a documented deep link contract.