A practical series

Shopify App Handbook

Nineteen short notes that take you from never having built a Shopify app to working on a real one. Written for people starting from zero — every term is explained before it is used, and every note ends with the traps that cost real time.


Start here

  1. Learn the pieces: read 01 → 09 in order. Each builds on the last. (Already know React? Start at 04.)
  2. Build something: work through 14, a complete app from start to finish. This is where it clicks.
  3. Ship it: read 10 → 13 when you are ready for a real server and real merchants.
  4. Going public? 15 → 17 are required for the Shopify App Store. Skip them for apps built for a single client.

Keep 18 open whenever something is not working.


Foundations

Data

Building the interface

Put it all together

Running in production

Shipping to merchants

Public App Store apps

Tools

Going further

The five mistakes that cost the most time

Collected from across the series. If you only remember a handful of things, make it these.

  • Unscoped database queries. A query without where: { shop } returns every shop's rows. Invisible while one shop is installed; a data breach when the second arrives. (04, 05)
  • Unread userErrors. A failed Shopify mutation still returns HTTP 200. Without checking, your code reports success while nothing saved. (06)
  • Forgetting to paginate. first: 50 looks perfect on a small test shop and silently truncates on a real one. (06)
  • The uninstall cascade. Deleting the session row on uninstall can erase everything that shop ever created. (04, 05)
  • Deploying only half. Code goes to your host; settings go to Shopify. Most changes need both. (11)
  • Treating an error as "unpaid". If a subscription check fails and you redirect anyway, you lock out a paying merchant. Only a successful empty answer means no plan. (16)
  • Assuming new permissions apply automatically. After you release a version with new scopes, every merchant must approve it in their own admin. (12, 13)

Your first week, in order

# set up
npm install
npx prisma generate
shopify app dev

# every new page
loader  → read data    (scope it by session!)
action  → write data   (check userErrors)
default → the UI

# before every production deploy
back up the database
shopify app info        # am I on the right app?
read the migration SQL
deploy code AND settings
open the app and click through

How to use these

Each note is self-contained and copy-paste friendly. They are written generically — myapp.com, db.widget — so they apply to any Shopify app, not one specific project.

One caveat

Shopify's APIs change every quarter. The concepts here are stable, but before copying an exact field name or mutation, check it against the docs for your pinned API version, or test it in shopify app graphiql first.