Wishlist
Apps/Recipes/Wishlist

Add a customer wishlist to a Shopify store

Signed-in customers save products with a heart on product pages and keep them on a wishlist page rendered in the store's own theme. It needs no Shopify scopes: wishlists live in the app's records, and product details come from Liquid on the storefront.

Shopify, customScopes noneRecipe id wishlist

What you'll build

Product pageWishlist buttonApp proxy/proxy/wishlist/itemswishlistItem.createonce per productWishlist pagerendered in Liquid

What it shows: A block that asks the app for its state, proxy routes answered as JSON and as application/liquid, and a unique field that keeps one record per customer and product.

Before you start

  • The CLI: npm i -g @inferencebureau/apps, then ib-apps login once.
  • A Shopify Partner organization, and a development store to install on.
  • Resend, for data requests.

Create the app from the recipe

One command creates the app on Inference Bureau and downloads its files into ./my-wishlist. Shopify recipes need --platform shopify.

ib-apps create my-wishlist --platform shopify --recipe wishlist

Tour what the recipe loaded

The recipe lies over the Shopify starter: files of the same path are replaced, and the starter's storefront block is dropped. Here's where each piece lives.

WhereWhat's there
api/models/wishlistItem/schema.ib.tsOne saved product, with a unique key (<shop>:<customerId>:<productGid>) so a product is saved once.
actions/create.ts, delete.tsSave (sets key and addedAt) and remove.
extensions/wishlist/The Wishlist button block. Shopify renders it in the "not saved" state; its script asks the app whether this customer saved the product, then saves or removes it. Guests see "Sign in to save".
web/lib/wishlist.tsWhat the proxy routes share: the signed-in customer from verifyProxyRequest, reads and writes through createClient(), and the checks every value passes. At most 200 products.
web/app/proxy/wishlist/route.tsThe wishlist page, answered as application/liquid. Liquid looks each product up with all_products (20 per render, so 20 per page).
proxy/wishlist/state/, items/GET ?product=<gid> answers { saved }; POST { op, product, handle } adds or removes. JSON only, so a form on another site can't post as a signed-in customer.
web/app/page.tsx, summary.tsxThe admin page: how many products are saved, by how many customers, and the 20 most wishlisted.
api/actions/shopifyCustomers*.tsShopify's privacy webhooks: customers/redact deletes the customer's wishlist; customers/data_request emails them to the store's owner through the team's own Resend account.
export const schema: ModelSchema = {
  type: "ib/model-schema/v1",
  fields: {
    shop: { type: "string", storageKey: "wlShop", validations: { required: true } },
    customerId: { type: "string", storageKey: "wlCustomer", validations: { required: true } },
    productGid: { type: "string", storageKey: "wlProduct", validations: { required: true, regex: { pattern: "^gid://shopify/Product/\\d+$" } } },
    productHandle: { type: "string", storageKey: "wlHandle", validations: { required: true, regex: { pattern: "^[a-z0-9][a-z0-9-]*$" } } },
    variantGid: { type: "string", storageKey: "wlVariant" },
    addedAt: { type: "dateTime", storageKey: "wlAddedAt" },
    key: { type: "string", storageKey: "wlKey", validations: { required: true, unique: true } },
  },
};

Check what it set on the app

Nothing to do here: this is what the recipe configured, so you know where to look in Settings later.

PlatformShopify, custom
Scopesnone
Admin pagesInference Bureau
Webhookscustomers/redact, customers/data_request

Connect Shopify and install

  1. Create the Shopify app in your Partner organization
  2. Install on a development store
  3. Add the Wishlist button block to a product template in the theme editor

Run it

ib-apps dev syncs both ways while you work and runs the development server. Saving anything under extensions/ releases it to the development Shopify app by itself.

cd my-wishlist
ib-apps dev

Logs show a succeeded config release once the extension is live.

Try it end to end

0 of 4 checked

Make it yours

Restyle the button

extensions/wishlist/assets/wishlist.css and blocks/wishlist-button.liquid.

Change the page

The Liquid the page renders is in web/app/proxy/wishlist/route.ts.

Ship it

ib-apps deploy sends development to production. See Deploys.