Shopify embedded app · Open-source template

Shopify on Cloudflare

A production-ready starter for building Shopify embedded apps on Cloudflare Workers, with session-token auth, Hono routing, Drizzle on D1, KV-backed sessions, and R2 storage, plus a React + Polaris frontend. All at the edge, zero cold starts.

edge status · live
>GET /healthchecking
>GET /api/examplechecking
Embedded app

This is a preview of an open-source template, not a running store. Shopify embedded apps render inside the Shopify Admin iframe, so they have no standalone URL of their own. The live app runs inside a merchant's admin. This page shows what the template is and how it's built.

The stack

Built on the edge

Cloudflare Workers Hono D1 + Drizzle ORM KV · sessions R2 · files React 18 · Vite Shopify Polaris App Bridge

How it fits together

Request flow

  1. Browser · Shopify Admin
    Loads the embedded app inside an iframe.
  2. App Bridge
    Mints a short-lived session-token JWT on every request.
  3. Cloudflare Worker · Hono
    Verifies the JWT, then routes the request:
    • /shopify/install /shopify/callback · OAuth install & callback
    • /api/* · guarded by the requireShop middleware
    • /* · React + Polaris SPA (static assets)
  4. D1 · KV · R2
    Shop data, Shopify sessions, and file storage, all at the edge.

What's included

Wired up out of the box

Get started

Three steps to running

  1. Clone the repo and run npm install.
  2. Create the D1, KV, and R2 resources, then set your Shopify secrets (see the README).
  3. Run npm run dev locally, or npm run deploy to ship to Cloudflare.