Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Deploying an app vs deploying an app extension

sancuscommerce
Shopify Partner
15 1 2

I have a remix shopify app i created with "npm init @Shopify/app@latest" and then added an app extension using "npm run shopify app generate extension".

 

To test and run the app, i use "npm run dev" which works fine for development purposes.

 

Now that the app and extension are completed, I need to package and deploy this for the app store.  Am I correct in thinking that the extension is hosted by shopify, but I need to host the app myself (probably using an AWS EC2 server)?

 

If so, how do I deploy the extension folder to the shopify servers and then deploy the app folder to my server? I'm not sure what "npm run deploy" does exactly.. I'm assuming it will just copy the extensions folder to shopify.

 

Can anyone shed some light on how this works and what needs to be done to deploy/host a public app?

Replies 4 (4)

Liam
Shopify Staff
2669 288 730

Hi Sancuscommerce,

 

The `npm run deploy` command is essentially a wrapper around Shopify CLI commands, and is used to deploy your extensions to Shopify. When you run this command, it bundles your extension and uploads it to Shopify's servers. After deploying, you'll need to publish the extension from your Partner Dashboard. This makes the extension available to merchants within the Shopify admin. There's more info on deployment and distribution in our docs here

 

Hope this helps, 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

ndrtek
Shopify Partner
12 0 8

Hello @Liam .

 

Can you expand about your answer a bit... I am having similar confusion about the relationship between what I am deploying to my own hosting solution, and what is deployed when I run "npm run deploy" and/or create a new "version" in the Shopify Partner Dashboard.

 

So for instance, I have an app which has 3 extensions. One extension is a UI Extension and two are Shopify Functions. The "app" portion of my app has nothing except some built in routes, a landing page for installation, and a home page.

 

Where is the code for these executed from... my hosting solution, or Shopify's hosting solution?

 

If the latter, is the the deploy command uploading my code to Shopify's servers?

 

If that's the case, then do I even need to set up my own hosting for any reason? Why?

 

What is an example of an app type that would execute code on my hosting solution instead of uploading into Shopify? Would that basically be any app that does NOT use an "extension"?

 

In such a case, do I need to still create "versions" in the Partner Dashboard, or do I just deploy new code to my own hosting environment when I want to make a change to my app?

 

I hope my confusion is clear (lol) and you can help me better understand the overall picture of Shopify App / Extension intended hosting, deployment, and versioning patterns.

 

TY!

Gabe

pedro210
Shopify Partner
2 0 0

I second that. Shopify's documents are so unclear about all this. For me the biggest question is where is the database hosted ? inside each merchant's shopify or do I host a database for all my users ?!

ndrtek
Shopify Partner
12 0 8

Hi @pedro210 .

 

After more testing and experimenting and deploying our app in Development, Staging, and Production environments... I think I have a better sense of it.

 

I've memorialized my understanding in some detail here. Over time I may improve that article. I welcome your feedback.

 

In a nutshell...

 

Anything you have under the "app" directory has to be hosted on your own platform, including any database that code uses which is not storing in Shopify itself.

 

Anything you have under the "extensions" directly has to be deployed via CLI using "npm run deploy"... and will be hosted by Shopify.

 

Furthermore, you will need a "Shopify App" created in the Partner Dashboard, which is really just a container for configurations (including pointing to your Web App host url in the case of your "app" code) and metrics... and a Version Release manager for your App Extensions.

 

Hope that helps!

 

G