I am developing a private Shopify app that requires injecting a script into both the Shopify Admin Panel and the Online Store. While attempting to create a Script Tag with display_scope: “all”, Shopify automatically modifies the scope to “online_store”, preventing my script from loading in the Admin area.
Key Details:
• The app is private, not listed on the Shopify App Store.
• I have the write_script_tags and read_script_tags permissions enabled.
• The API request successfully creates a Script Tag, but Shopify forces display_scope: “online_store” instead of “all”.
• My app is intended to provide custom calculations for orders and needs to be available in the Shopify Admin backend. (Order drafts)
Questions:
Is it possible for a private app to use display_scope: “all”, or is this limited to public apps?
If display_scope: “all” is restricted, what are my alternative options for injecting scripts into the Admin Panel?
You can’t inject JS code into the Admin Panel directly. The all display scope used to cover both the Order Status page and the Online Store. But now the Order Status page is only modifiable by App Blocks (aka Account / Checkout Extensions).
However, you can publish app blocks that can be added to order and product admin pages by the merchant’s staff:
You can develop an admin extension using the Shopify CLI, then merchants have the choice to include it in their admin area.
Thank you for your response—I wasn’t aware of Admin Extensions, and I appreciate the insight!
I have two follow-up questions regarding their functionality:
Do Admin Extensions work with private apps, or are they limited to public/partner apps?
After reviewing the documentation, it seems that Admin Extensions may not allow me to directly modify the /draft_orders/new page. Specifically, I noticed that while creating a new order in the Shopify Admin, there is no “More Actions” or “three-dot” menu available to trigger an extension.
Would you be able to confirm if there’s an alternative method to extend the new draft order creation page with additional calculated data?
I believe so, I’m not aware of any restriction for public only apps. But deploying an test admin extension is as simple as running shopify app generate and shopify app dev after logging in.
I believe what you’re thinking of is Admin Extension Links. They’re slightly different. They can open arbitrary links in your app at different mounting points in the admin area.
Thank you for the detailed response and for pointing me to the Admin Extension Links. I really appreciate your help!
After reviewing the documentation, it seems that unfortunately, our idea will not work with the current Shopify Admin Extensions. Specifically, we were hoping to inject additional calculated data while creating a new draft order in /draft_orders/new, but as far as I can tell, Shopify does not provide an extension target for that page.
While the Admin Action Extensions on the draft order details page are useful, they only allow us to interact with an order after it has been created. Unfortunately, this does not align with our original goal of displaying further calculations during the order creation process.