An embedded Shopify app that runs on floo: it opens inside Shopify admin, signs merchants in with Shopify, stores their sessions in floo's managed Postgres, and receives webhooks. It is Shopify's React Router app template with the changes floo needs, so Shopify's docs for that template apply here.
- Postgres instead of SQLite.
prisma/schema.prismareadsDATABASE_URL, which floo injects from[managed.default]infloo.app.toml. The session table migration is rewritten for Postgres. - Migrations run once per deploy.
migrate_commandrunsprisma migrate deploybefore traffic moves; a failed migration stops the deploy and the previous revision keeps serving. The container only starts the server. - The app URL comes from floo. On floo,
app/shopify.server.tsusesFLOO_APP_URL, the app's public URL.shopify app devstill setsSHOPIFY_APP_URLto its tunnel locally. - Public access mode. Shopify verifies every request itself: the embedded admin sends a session token and webhooks carry an HMAC signature. floo's sign-in can't sit in front of either, so
access_mode = "public". - A committed
package-lock.jsonandshopify.web.toml, sonpm ciandshopify app devwork from a clone.
The app sends Content-Security-Policy: frame-ancestors for the merchant's shop and admin.shopify.com on every page (Shopify's addDocumentResponseHeaders in app/entry.server.tsx). Keep it: floo's gateway sends X-Frame-Options: SAMEORIGIN, and browsers let the app's frame-ancestors override it. Without that header, the app shows a blank frame inside Shopify admin.
You need a Shopify Partner account, a development store, and the Shopify CLI.
-
Click Use this template on GitHub to create your own repository, and clone it. Change
nameinfloo.app.tomlif you want a different app name. -
Create the Shopify app and link this folder to it:
npm install shopify app config link
-
Deploy from the folder. floo connects your GitHub repository, creates the app and starts a deploy, which stops and lists the three variables it needs:
floo deploy
-
Copy the client ID and secret from your app in the Shopify Dev Dashboard and set them on floo.
SCOPESmust matchscopesinshopify.app.toml:floo env set SHOPIFY_API_KEY --stdin floo env set SHOPIFY_API_SECRET --stdin floo env set SCOPES=write_products floo deploy --rebuild
-
Point Shopify at the floo URL. In
shopify.app.toml, setapplication_urlto your app's URL (https://<name>.getfloo.app) andredirect_urlsunder[auth]tohttps://<name>.getfloo.app/auth/callback, then release the configuration:shopify app deploy
-
Install the app on your development store from the Dev Dashboard and open it in Shopify admin.
The full walkthrough, including production stores and local development, is at getfloo.com/docs/deploy/shopify-app.
Give your agent prompts like these:
- "Add a page that lists the store's 20 most recent orders with totals, using the Admin GraphQL API."
- "Subscribe to the
orders/createwebhook and save each order's ID, total and created time in a new Postgres table." - "Add a daily floo cron job that records products whose inventory is below 5."
- "Add the three mandatory compliance webhooks for App Store review and delete a shop's data on
shop/redact."
shopify app dev runs the app behind a Shopify tunnel and needs a DATABASE_URL. floo run injects your floo dev database's credentials into a command:
floo run --service web -- shopify app devIf shopify app dev updates your app's URLs to its tunnel, run shopify app deploy afterwards to point them back at floo.
MIT. Based on Shopify's app template, copyright Shopify Inc.; see LICENSE.md.