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
-
Browser · Shopify AdminLoads the embedded app inside an iframe.
-
App BridgeMints a short-lived session-token JWT on every request.
-
Cloudflare Worker · HonoVerifies the JWT, then routes the request:
/shopify/install/shopify/callback· OAuth install & callback/api/*· guarded by therequireShopmiddleware/*· React + Polaris SPA (static assets)
-
D1 · KV · R2Shop data, Shopify sessions, and file storage, all at the edge.
What's included
Wired up out of the box
- Shopify OAuth + session-token auth. Every
/api/*route is protected by middleware - KV-backed Shopify session storage
- D1 + Drizzle with a single
shopify_shoptable to extend - Install / uninstall lifecycle, including the
app/uninstalledwebhook - An example protected route (
GET /api/example) and a Polaris page that calls it
Get started
Three steps to running
- Clone the repo and run
npm install. - Create the D1, KV, and R2 resources, then set your Shopify secrets (see the README).
- Run
npm run devlocally, ornpm run deployto ship to Cloudflare.