Skip to content

Setup your Gadget app

First, let’s add Brush to a Gadget app. This adds context enhancements, Shopify Storefront API token, localization info and so on.

  1. Head to gadget.dev.
  2. Click on the “Create app” button and follow the login process.
  3. Once landed on your main Gadget dashboard, click on the ”+ Create app” button.
  4. On the “Create new app” page, make sure to choose “Shopify app” and an app type of “Custom app” and continue (those should be the defaults).
  5. Set an app name of your choice and keep the default options (Frontend: React Router v7 framework mode ; Language: Typescript). And confirm.
  1. On the main pane of your Gadget app admin, you should see this: Shopify setup

  2. Select “Choose a different method”.

  3. Then, choose “Use different connection methods”.

  4. In the “URLs” section, copy both the “App URL” and “App redirection URL”.

  5. Leave the page as is for now.

  1. From your Shopify Dev Dashboard (https://dev.shopify.com/dashboard), create a new app.
  2. Use the “Start from Dev Dashboard” option and fill the “App name” field with a name for your Shopify app.Shopify app name
  3. In the “App URL” field, paste the “App URL” you copied from Gadget earlier.
  4. Further down, check “Use legacy install flow”.
  5. In the “Redirect URLs” textarea, paste the “App redirection URL” you copied from Gadget earlier.
  6. Deploy the “App Proxy” box at the bottom and choose “apps” for the “Subpath prefix”, “brush” for the “Subpath”…
  7. … for the “Proxy URL”: use the main URL from the Gadget’s “App URL” and happen /brush. For example, if your Gadget’s “App URL” is https://brush-tutorial--development.gadget.app, the “Proxy URL” value must be https://brush-tutorial--development.gadget.app/brush.
  8. Click the “Release” button at the top of the Shopify “Create a version” page you are currently browsing, enter any detail you wish in the modal that appears and confirm the release by clicking “Release”.
  9. Reach out to the “Settings” page of your Shopify app and copy both “Client ID” and “Secret”.

From the page you left off earlier in the Gadget admin (“Connect to Shopify”):

  1. Paste the “Client ID” and “Secret” you copied just before from your Shopify app in the Shopify Dev Dashboard.
  2. Click “Continue”.
  3. Make sure to check “Read” for both “[Admin API] Themes” and “[Storefront API] Product listings”. The “API scopes” section in the right column must look like that:API scopes
  4. Confirm. This shows up a modal box that you can close straight ahead.
  5. Do not worry about the “Install your app on a dev store” warning that shows up, we’ll come to it later.
  6. From the left column named “Settings”, choose “Environment variables” and add a new entry with the Key SHOPIFY_APP_CLIENT_SECRET and paste the “Secret” you got from your Shopify app “Settings” page earlier.
  7. You may want to click the lock to hide the key. It will then be hidden forever until you re-enter the key.
  8. Save the settings.

⚠️ Make sure you do have Yarn installed as Gadget uses it instead of npm.

  1. Go to a terminal and cd to the folder in which you want to install and run your backend app.
  2. In the top left corner of your Gadget app admin, look for the icon that shows a cloud with a link.GGT install
  3. Run the 2 commands and, for the second one (ggt dev ...), wait for the setup to run and Waiting for file changes… to show in the terminal.
  4. Kill the command so that Waiting for file changes… is stopped and you get access back to the terminal prompt.
  5. cd into the subfolder that was created during ggt dev....
  6. Run npm create brush@latest
  7. Choose “Backend” and continue
  8. Use . for the “In which relative directory to install?” question and let the Brush installer run.
  9. Run ggt dev in order to relaunch the Gadget app. You may see errors in the output but this is normal as Gadget must install new dependencies ; which it will do automatically.
  1. From your Shopify Dev Dashboard, reach out to the “Dev stores” page and create a new dev store of your choice.
  2. Now, reach out to the “Apps” page and choose your Shopify app.
  3. Click on the “Install app” button of the “Installs” box and follow the process by choosing the dev store you just created.
  4. You should now have your Shopify app powered by Gadget in your dev store’s admin 🎉Shopify admin app