Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to automatically enable App embeds extension when app installed?

How to automatically enable App embeds extension when app installed?

xBei-Qiu
Shopify Partner
11 1 1

xBeiQiu_0-1717594727072.png

thanks.

 

Replies 3 (3)

Huptech-Web
Shopify Partner
1047 208 225

Hello @xBei-Qiu 

Enabling the "App Embeds" extension automatically isn't feasible. Instead, you can redirect through your app within the App Embedded Block. These extensions only become enabled for merchants to save them after activating the block.

Here's an example link for redirection:

https://admin.shopify.com/store/${shopName}/themes/${themeEditorId}/editorcontext=apps&template=index&activateAppId=${EXTENSION_ID}/${EXTENSION_NAME}

In this link:

themeEditorId is obtained via the admin REST API theme.json.
EXTENSION_ID is Enter Your theme app extension id.
EXTENSION_NAME is your theme app extension name.

If the solution presented meets your needs and addresses your query effectively, I encourage you to accept it as the chosen answer. This will acknowledge the support you received and aid fellow community members in identifying reliable and effective solutions for their similar concerns.
Thank you.

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
xBei-Qiu
Shopify Partner
11 1 1

thank.

your solution work.

 

activateAppId=${EXTENSION_ID}/${EXTENSION_NAME}

 

This part may need to be encoded(encodeURIComponent)
my code
 

 

const actAppId = encodeURIComponent(`${EXTENSION_ID}/${EXTENSION_NAME}`);
const url = `https://admin.shopify.com/store/${shopName}/themes/current/editor?context=apps&activateAppId=${actAppId}`;

 

 

but

I still hope to find a way to automatically activate it

but,

Huptech-Web
Shopify Partner
1047 208 225

@xBei-Qiu 

Automated activation isn't feasible within Shopify. All Shopify apps available in the store necessitate manual steps for enabling the extension on the store, as indicated in the provided code above

If the solution presented meets your needs and addresses your query effectively, I encourage you to accept it as the chosen answer. This will acknowledge the support you received and aid fellow community members in identifying reliable and effective solutions for their similar concerns.
Thank you.

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required