Connecting via the Shopify CLI 

To get started building Shopify apps, we must first set up the Shopify connection.

This quickstart will walk through steps to connect Gadget to a Shopify app using the Shopify CLI, which is our recommended way to connect. If you prefer not to set up the connection manually, you can ask the assistant to set up the connection for you.

By connecting via the Shopify CLI, you allow Gadget to create, edit and delete apps across your Shopify Partner organization. If you wish to restrict Gadget's permissions to only the application in question, use the manual Shopify Partner connection flow.

Step 1: Create a new Gadget app 

To start, we need to create a new Gadget app.

  1. Create a new Gadget app at gadget.new and select the Shopify app type.
  2. Enter a domain name and click Confirm.

Step 2: Authenticate with Shopify 

If you don't have a Shopify Partner account, follow this link to create one: Shopify Partner dashboard

  1. Click on the Connect to Shopify button to open the Shopify plugin page.
  2. Click Connect via Shopify CLI
  3. Log in to the Shopify Partner dashboard and click Confirm and log in

CLI authentication tokens might expire after some time, requiring this step to be repeated.

Step 3: Create a Shopify application 

  1. Select an organization in which to create the app. Note that this step will not appear if you are only part of one organization.
  2. Name and create your new Shopify application

Gadget automatically sets up GDPR webhook URLs and configures your Shopify app with them. Be sure to handle GDPR webhook requests in the create action of the ShopifyGDPRRequest model.

Step 4: Select scopes and models 

In order to authenticate with Shopify, it is required to select at least one scope. If you would like Gadget to register and receive webhooks for particular resources, also select models.

  1. Select the scopes you'll need for this application.
  2. Click Confirm to move to the next step.

Step 5: Install the app in a Shopify store 

If you don't have a development store, you can create one by clicking the Create a new store button. Once the store is created, navigate back to your Gadget app and click Refresh to see the new store.

  1. Select the store that you wish to install the app on.
  2. Click Install app to install the app on the store.

Step 6 (Optional): Sync Shopify data 

When a Shopify connection is created, Gadget creates a model named shopifySync. Creating records on that table (with the run action) will trigger a sync of Shopify data. You can also run this sync manually via the shop installs page.

  1. Navigate to the Installs page from Settings -> Plugins -> Shopify, or through the icon in the left side nav.
  2. Find the store that you've just installed the app on and click the Sync button.

Next steps 

Try out some of our other tutorials to learn more about building with Gadget:

Questions? 

Reach out on Gadget's Discord server to talk with Gadget employees and the Gadget developer community!

Was this page helpful?