[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FBHWZRBMBPJ705PTDYTX9X":3,"skill-same:01M6FBHWZRBMBPJ705PTDYTX9X":93},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":6,"ownerHtmlUrl":63,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":64,"install":65,"resources":78},"01M6FBHWZRBMBPJ705PTDYTX9X","shopify-firebase-app",null,"Scaffold, extend and deploy Shopify embedded apps on Firebase with Nitrogen. Use for a Shopify app on Cloud Functions, Firestore and Hosting, or inside a Nitrogen project.","boisenoise\u002Fskills-collections","boisenoise","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F193180?v=4","01M6CDBDQK6BDN55ZMA6B6PKBM","01M6CDBDVSJ3JPTBYN26FZ7TZK",13,"MIT","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-shopify-firebase-app\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"firebase","shopify firebase app","shopify","app","project","2026","extend","cloud functions","for","polaris","shopify-app","with","apps","critical","gemini","community","functions","master","use","bridge","cloud-functions","license","development","copilot","2026-11-10 10:12:30",false,"---\nname: shopify-firebase-app\ndescription: \"Scaffold, extend and deploy Shopify embedded apps on Firebase with Nitrogen. Use for a Shopify app on Cloud Functions, Firestore and Hosting, or inside a Nitrogen project.\"\ncategory: development\nrisk: critical\nsource: community\nsource_repo: mksd0398\u002Fnitrogen\nsource_type: community\ndate_added: \"2026-10-23\"\nauthor: mksd0398\ntags: [shopify, shopify-app, firebase, cloud-functions, firestore, polaris, app-bridge]\ntools: [claude, cursor, codex, copilot, gemini]\nlicense: \"MIT\"\nlicense_source: \"https:\u002F\u002Fgithub.com\u002Fmksd0398\u002Fnitrogen\u002Fblob\u002Fmaster\u002FLICENSE\"\n---\n\n# Shopify Apps on Firebase, with Nitrogen\n\n## Overview\n\nNitrogen (`npx @mksd0398\u002Fnitrogen`) scaffolds a Shopify embedded app on Firebase. It has one Cloud Function (gen 2, Node.js 24) per API resource, in TypeScript or JavaScript, plus Firestore, Hosting and Secret Manager. Its pages are plain HTML built from Polaris web components and App Bridge, with no build step. An app is single- or multi-tenant, and every generated project has a test suite.\n\nTwo rules come before anything else:\n\n- **Working inside an app?** Read its `AGENTS.md` first; it is the project's own guide. Apps made before Nitrogen 3.4 have none, so read [references\u002Fapp-guide.md](references\u002Fapp-guide.md) instead. It is the same guide, written for TypeScript; a JavaScript app has `.js` files.\n- **Building UI?** Use [references\u002Fpolaris.md](references\u002Fpolaris.md) for every Polaris web component, and [references\u002Fapp-bridge.md](references\u002Fapp-bridge.md) for the `shopify` global. Never use Polaris React or `@shopify\u002Fapp-bridge-react`.\n\nAdapted from the [upstream skill](https:\u002F\u002Fgithub.com\u002Fmksd0398\u002Fnitrogen\u002Ftree\u002Fmaster\u002Fskills\u002Fshopify-firebase-app) (MIT). Nitrogen is an independent project, not affiliated with or endorsed by Shopify or Google.\n\n## When to Use This Skill\n\n- Use when someone wants a Shopify app on Firebase (Cloud Functions, Firestore, Hosting), or a Shopify app without Remix, React Router or a server.\n- Use when they mention Nitrogen or `npx @mksd0398\u002Fnitrogen`.\n- Use when working in a Nitrogen project, recognisable by `functions\u002Fsrc\u002Fapi\u002F`, `web\u002F*.html` pages with `\u003Cs-app-nav>`, and an `AGENTS.md` that names Nitrogen.\n- Use it to create such an app, to add APIs, webhooks, pages, scopes or Firestore data to one, and to deploy it.\n- Do not use it for Shopify apps built on Remix or React Router, such as those from `shopify app init`.\n\n## How It Works\n\n### Step 1: Get what only the user can give\n\nInspect existing authorized project configuration and account context first. Ask only for missing decisions; never invent identifiers or request secrets in chat.\n\n| You need | Where the user finds it |\n|---|---|\n| Shopify client ID and secret | The app's settings in the Shopify Dev Dashboard. Create the app there first if it does not exist. |\n| A Firebase project ID | An existing project, or a new id (6 to 30 characters: lowercase letters, digits, hyphens) for you to create with `--create-project`. |\n| The Blaze plan on that project | `https:\u002F\u002Fconsole.firebase.google.com\u002Fproject\u002FPROJECT_ID\u002Fusage\u002Fdetails`. Functions and Secret Manager need it. It is pay as you go, with a free monthly allowance. |\n| One store, or any store | One store makes it single-tenant (`--shop=STORE.myshopify.com`). Any store makes it multi-tenant (leave `--shop` out). |\n| Where the data lives | A Firestore location such as `us-central1` or `europe-west1`. It cannot be changed later, so ask. |\n\nChoose the scopes from the feature yourself. Keep `read_products` only if the requested starter\u002Fproduct UI actually needs it; remove unused starter pages instead of retaining unnecessary access, and add what the feature needs: orders need `read_orders`, and so on. Add `write_` scopes only for what the app changes.\n\nUse the host's approved interactive authentication flow for: `firebase login` now, and `shopify auth login` before the first `shopify app deploy`.\n\nAsk the user to save the client secret to `secret.txt` in the folder you will run the CLI from, which is outside the app. Do not ask them to paste it into the chat, and never print it. Once it is stored in Secret Manager, they can delete the file.\n\n### Step 2: Scaffold\n\nThe scaffolder is third-party executable code with package-install, cloud-provisioning and Git-commit effects. Review the selected version and its dependency\u002Flifecycle behavior before execution; use an isolated new project directory. `--skip-provision` is only a cloud-provisioning switch, not a sandbox or a guarantee of no local\u002Fnetwork side effects. Do not run a provisioning path until the intended Firebase project, region, billing and resource effects are authorized. Store `secret.txt` outside Git\u002Fsynced folders with owner-only permissions and no tracing; environment variables are not immune to child-process\u002Flog disclosure. Unset the secret after use and remove the temporary file once secure storage is verified.\n\n\nThere is no terminal to answer the wizard's questions in, so pass every answer as a flag:\n\n```bash\nIFS= read -r SHOPIFY_API_SECRET \u003C secret.txt  # Private file; disable tracing; no newline in the value\nexport SHOPIFY_API_SECRET\nnpx \"@mksd0398\u002Fnitrogen@${NITROGEN_VERSION:?Set the approved reviewed version}\" my-app \\\n  --api-key=CLIENT_ID \\\n  --project-id=PROJECT_ID \\\n  --firestore-region=us-central1 \\\n  --scopes=read_products,read_orders\n```\n\n| Flag | Use it when |\n|---|---|\n| `--create-project` | The Firebase project does not exist yet. |\n| `--shop=STORE.myshopify.com` | The app is for one store. |\n| `--language=javascript` | The user wants JavaScript. TypeScript is the default. |\n| `--region=REGION` | The functions should run somewhere other than next to Firestore. |\n| `--overwrite` | `my-app` exists and the user said to replace it. |\n| `--skip-provision` | A trial run that touches nothing in Firebase. For a real app, leave it out. |\n\nRun it from the parent folder; it creates `my-app\u002F`. It stops with exit code 1 when a flag is missing or the folder already has files, and says why. It never replaces the folder it runs from. `--no-deploy` and `--skip-shopify` belong to the interactive wizard and do nothing here.\n\nWhat it does: it creates Firestore and a Firebase web app (both only with `--firestore-region`), stores the secret in Secret Manager, installs dependencies, builds, runs `git init` and commits. It does not deploy, and \"All done\" means the scaffold is done.\n\nRead its output for these warnings. Run the commands from inside `my-app`.\n\n- **\"Firebase project … not found in your account\".** Either the project does not exist, so ask the user whether to create it (`firebase projects:create PROJECT_ID --display-name \"App name\"`), or they are signed in to another Google account (`firebase login:list`). Then set up Firebase by hand, as below.\n- **\"This project is on the Spark (free) plan\".** The user upgrades to Blaze. Then store the secret: `firebase functions:secrets:set SHOPIFY_API_SECRET --data-file=..\u002Fsecret.txt --project=PROJECT_ID`.\n- **\"Could not store the Client Secret\".** Run that same command once the project is on Blaze.\n\nWhen the setup was skipped, or stopped early, finish it by hand:\n\n```bash\nfirebase firestore:databases:create \"(default)\" --location=LOCATION --project=PROJECT_ID\nfirebase functions:secrets:set SHOPIFY_API_SECRET --data-file=..\u002Fsecret.txt --project=PROJECT_ID\n```\n\n### Step 3: Deploy and install\n\n```bash\ncd my-app\ncd functions && npm test && cd ..\nfirebase deploy --project PROJECT_ID\nshopify app deploy\n```\n\n`firebase deploy` ships the functions, the pages and the Firestore rules. `shopify app deploy` sends `shopify.app.toml` to Shopify: the app URL, scopes and webhook subscriptions. The user then installs the app from the Dev Dashboard onto a development store. `https:\u002F\u002FPROJECT_ID.web.app\u002Fauth?shop=STORE.myshopify.com` also works.\n\n### Step 4: Change an app\n\nFollow the app's `AGENTS.md`. These are the steps agents miss most:\n\n- **A new API** needs its file in `functions\u002Fsrc\u002Fapi\u002F`, an export in `functions\u002Fsrc\u002Findex`, and two rewrites in `firebase.json`. The rewrites use the lowercase export name and the same region as the others. `npm test` fails if the three disagree.\n- **A new scope** goes in `shopify.app.toml` and `functions\u002F.env`, then needs `shopify app deploy`. Merchants approve it the next time they open the app.\n- **Orders and customers** are protected customer data. The user selects the data the app uses in the Partner Dashboard, under the app's API access; apps made in the Dev Dashboard are listed there too. Until then, Shopify refuses order and customer webhooks, even on a development store.\n- **A new Firestore collection** is keyed by `tenantId(ctx.app, ctx.shop)` and listed in `TENANT_DOCS` or `TENANT_FIELD` in `functions\u002Fsrc\u002Fwebhooks`. That way `shop\u002Fredact` deletes it.\n- **A new page** needs its link added to the `\u003Cs-app-nav>` of every page, because each page carries its own copy.\n- **A new webhook topic** reaches the app only after `shopify app deploy`.\n\nRun `cd functions && npm test` after every change, and before every deploy.\n\n## Examples\n\n### Example 1: A one-store JavaScript app on a new Firebase project\n\nThe user gave the client ID, a new project id, their store and the location `europe-west1`, and saved the secret to `secret.txt`. The feature reads orders.\n\n```bash\nIFS= read -r SHOPIFY_API_SECRET \u003C secret.txt  # Private file; disable tracing; no newline in the value\nexport SHOPIFY_API_SECRET\nnpx \"@mksd0398\u002Fnitrogen@${NITROGEN_VERSION:?Set the approved reviewed version}\" my-app \\\n  --api-key=CLIENT_ID \\\n  --project-id=PROJECT_ID \\\n  --create-project \\\n  --shop=STORE.myshopify.com \\\n  --language=javascript \\\n  --firestore-region=europe-west1 \\\n  --scopes=read_products,read_orders\n```\n\nOrders are protected customer data: Shopify refuses order webhooks until the user selects that data in the Partner Dashboard.\n\n### Example 2: Add an API resource\n\n1. Create `functions\u002Fsrc\u002Fapi\u002F\u003Cname>.ts`, starting from `functions\u002Fsrc\u002Fapi\u002Fstatus.ts`. A route returns the JSON to send, or throws `HttpError(status, message)`.\n2. Export it from `functions\u002Fsrc\u002Findex.ts`.\n3. Add rewrites for `\u002Fapi\u002F\u003Cname>` and `\u002Fapi\u002F\u003Cname>\u002F**` to `firebase.json`. `serviceId` is the export name in lowercase; `region` is the same as the other rewrites.\n4. Add tests next to `functions\u002Ftest\u002Fapi.test.js`, which shows how to sign a session token and stub Shopify.\n\n```bash\ncd functions && npm test && cd ..\nfirebase deploy --project PROJECT_ID\n```\n\n### Example 3: Add a webhook\n\n1. Subscribe in `shopify.app.toml` with a `[[webhooks.subscriptions]]` block, using the same `uri` as the others.\n2. Handle its topic in the `switch` in `functions\u002Fsrc\u002Fwebhooks.ts`. Answer within 5 seconds.\n3. Deploy the function, then send the subscription to Shopify:\n\n```bash\nfirebase deploy --only functions:webhooks\nshopify app deploy\n```\n\n## Best Practices\n\n- ✅ Read the app's `AGENTS.md` before changing it.\n- ✅ Take the shop and the app from what was verified, `ctx.shop` and `ctx.app`, never from a request's body, query or headers.\n- ✅ Treat a missing signature, session token or body as a refusal.\n- ✅ Keep the client secret only in Secret Manager, and in `functions\u002F.secret.local` for the emulator, which git ignores.\n- ✅ Reach Firestore only through functions, and keep `firestore.rules` denying every client.\n- ✅ Run `cd functions && npm test` after every change, and before every deploy.\n- ❌ Don't use Polaris React or `@shopify\u002Fapp-bridge-react`.\n- ❌ Don't loosen any check in `functions\u002Fsrc\u002Fverify`.\n- ❌ Don't invent the client ID, the secret or the Firebase project, and don't ask for the secret in the chat.\n\n## Deployment and data checks\n\nBefore any authorized deploy, inspect the actual generated source and dependencies, not just scaffold success. Test invalid\u002Fexpired\u002Fwrong-audience tokens, raw-body webhook HMAC, replay\u002Fidempotent webhook handling, cross-tenant reads\u002Fwrites and redaction coverage. Verify JWT signature, issuer, audience, time claims and tenant binding server-side; deny-client Firestore rules do not constrain Admin SDK code. Public invocation allows requests to reach the verifier; it is never a replacement for authentication. Confirm requested app\u002Fproject\u002Fstore and preserve existing resources. Tests passing does not independently prove these properties or authorize deployment.\n\n## Limitations\n\n- Cloud Functions and Secret Manager need the Blaze plan. Only the user can upgrade the project.\n- Authentication requires a supported interactive host\u002Fbrowser flow; do not guess account identity or expose credentials.\n- The Firestore location cannot be changed after it is created.\n- Shopify refuses order and customer webhooks until the user selects protected customer data in the Partner Dashboard.\n- Hosting ends a rewritten request at 60 seconds, whatever `timeoutSeconds` says.\n- Apps made before Nitrogen 3.4 have no `AGENTS.md`; use [references\u002Fapp-guide.md](references\u002Fapp-guide.md) for them.\n- Stop and ask when a value only the user can give is missing.\n\n## Security & Safety Notes\n\n- The scaffold changes the user's Firebase project: with `--firestore-region` it creates Firestore and a Firebase web app, and it stores the client secret in Secret Manager. `--create-project` and `firebase projects:create` create a project; use them only with the user's go-ahead. `--skip-provision` is a trial run that touches nothing in Firebase.\n- `firebase deploy --project PROJECT_ID` ships functions, pages and Firestore rules to the live project, and `shopify app deploy --allow-updates` sends the URL, scopes and webhook subscriptions to Shopify. Run them when the user has asked for a deploy, after `npm test` passes.\n- Do not add Firebase `--force`: it can suppress function-deletion confirmation. Inventory existing resources and use `--only` for the intended functions\u002Fhosting\u002Frules where possible, with the explicit target project. Review deletions before deployment.\n- `--overwrite` replaces an existing `my-app` folder. Pass it only when the user said to replace it.\n- The secret is loaded through the process environment rather than a CLI argument. It may still be exposed by tracing, child processes or logs; restrict file permissions, avoid output and unset it after setup.\n- Use the approved pinned Nitrogen version; a package name\u002Fversion pin alone is not a review of its transitive dependencies.\n\n## Common Pitfalls\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| `There is no terminal to ask the setup questions in` | The wizard needs a terminal | Pass the flags in Step 2 |\n| `\"my-app\" already has files in it` | The folder exists | Use a new name, or `--overwrite` if the user agrees |\n| `Firebase project \"…\" not found in your account` | It does not exist yet, or the user is signed in to another account | Create it with the user's go-ahead, or check `firebase login:list`; then finish the setup by hand |\n| Deploy says billing or the Blaze plan is required | The project is on Spark | The user upgrades; then store the secret as in Step 2 |\n| The Dashboard says it could not load store information | `read_products` was dropped from the scopes | Put it back |\n| Deploy asks for `SHOPIFY_API_SECRET` | The secret was never stored | `firebase functions:secrets:set SHOPIFY_API_SECRET --data-file=..\u002Fsecret.txt` |\n| `\u002Fapi\u002Fx` answers 404 from Hosting | The export and rewrite disagree, or the regions do | `npm test` names the mismatch |\n| Google's 403 page instead of JSON | `invoker: \"public\"` was removed | Inspect Hosting\u002Ffunction invocation configuration and application authentication before any IAM\u002Fpublic-exposure change |\n| Every call answers 429 `Rate exceeded.` just after billing was enabled | Google is still applying billing | Wait; it has taken 25 minutes |\n| A GraphQL call says access denied | A scope is missing or not yet approved | Add it as in Step 4. If it persists, inspect the token\u002Finstallation state; do not delete sessions as a blind fix |\n| `shopify app deploy` refuses an order or customer webhook | Protected customer data is not selected | The user selects it in the Partner Dashboard |\n\n## Additional Resources\n\n- [Nitrogen on GitHub](https:\u002F\u002Fgithub.com\u002Fmksd0398\u002Fnitrogen) (MIT licence)\n- [`@mksd0398\u002Fnitrogen` on npm](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@mksd0398\u002Fnitrogen)\n- [Upstream skill](https:\u002F\u002Fgithub.com\u002Fmksd0398\u002Fnitrogen\u002Ftree\u002Fmaster\u002Fskills\u002Fshopify-firebase-app), also installable with `npx skills add mksd0398\u002Fnitrogen`\n- Bundled references, copied from the upstream skill: [Polaris web components](references\u002Fpolaris.md), [App Bridge](references\u002Fapp-bridge.md), [App guide](references\u002Fapp-guide.md)\n","# Shopify Apps on Firebase, with Nitrogen\n\n## Overview\n\nNitrogen (`npx @mksd0398\u002Fnitrogen`) scaffolds a Shopify embedded app on Firebase. It has one Cloud Function (gen 2, Node.js 24) per API resource, in TypeScript or JavaScript, plus Firestore, Hosting and Secret Manager. Its pages are plain HTML built from Polaris web components and App Bridge, with no build step. An app is single- or multi-tenant, and every generated project has a test suite.\n\nTwo rules come before anything else:\n\n- **Working inside an app?** Read its `AGENTS.md` first; it is the project's own guide. Apps made before Nitrogen 3.4 have none, so read [references\u002Fapp-guide.md](references\u002Fapp-guide.md) instead. It is the same guide, written for TypeScript; a JavaScript app has `.js` files.\n- **Building UI?** Use [references\u002Fpolaris.md](references\u002Fpolaris.md) for every Polaris web component, and [references\u002Fapp-bridge.md](references\u002Fapp-bridge.md) for the `shopify` global. Never use Polaris React or `@shopify\u002Fapp-bridge-react`.\n\nAdapted from the [upstream skill](https:\u002F\u002Fgithub.com\u002Fmksd0398\u002Fnitrogen\u002Ftree\u002Fmaster\u002Fskills\u002Fshopify-firebase-app) (MIT). Nitrogen is an independent project, not affiliated with or endorsed by Shopify or Google.\n\n## When to Use This Skill\n\n- Use when someone wants a Shopify app on Firebase (Cloud Functions, Firestore, Hosting), or a Shopify app without Remix, React Router or a server.\n- Use when they mention Nitrogen or `npx @mksd0398\u002Fnitrogen`.\n- Use when working in a Nitrogen project, recognisable by `functions\u002Fsrc\u002Fapi\u002F`, `web\u002F*.html` pages with `\u003Cs-app-nav>`, and an `AGENTS.md` that names Nitrogen.\n- Use it to create such an app, to add APIs, webhooks, pages, scopes or Firestore data to one, and to deploy it.\n- Do not use it for Shopify apps built on Remix or React Router, such as those from `shopify app init`.\n\n## How It Works\n\n### Step 1: Get what only the user can give\n\nInspect existing authorized project configuration and account context first. Ask only for missing decisions; never invent identifiers or request secrets in chat.\n\n| You need | Where the user finds it |\n|---|---|\n| Shopify client ID and secret | The app's settings in the Shopify Dev Dashboard. Create the app there first if it does not exist. |\n| A Firebase project ID | An existing project, or a new id (6 to 30 characters: lowercase letters, digits, hyphens) for you to create with `--create-project`. |\n| The Blaze plan on that project | `https:\u002F\u002Fconsole.firebase.google.com\u002Fproject\u002FPROJECT_ID\u002Fusage\u002Fdetails`. Functions and Secret Manager need it. It is pay as you go, with a free monthly allowance. |\n| One store, or any store | One store makes it single-tenant (`--shop=STORE.myshopify.com`). Any store makes it multi-tenant (leave `--shop` out). |\n| Where the data lives | A Firestore location such as `us-central1` or `europe-west1`. It cannot be changed later, so ask. |\n\nChoose the scopes from the feature yourself. Keep `read_products` only if the requested starter\u002Fproduct UI actually needs it; remove unused starter pages instead of retaining unnecessary access, and add what the feature needs: orders need `read_orders`, and so on. Add `write_` scopes only for what the app changes.\n\nUse the host's approved interactive authentication flow for: `firebase login` now, and `shopify auth login` before the first `shopify app deploy`.\n\nAsk the user to save the client secret to `secret.txt` in the folder you will run the CLI from, which is outside the app. Do not ask them to paste it into the chat, and never print it. Once it is stored in Secret Manager, they can delete the file.\n\n### Step 2: Scaffold\n\nThe scaffolder is third-party executable code with package-install, cloud-provisioning and Git-commit effects. Review the selected version and its dependency\u002Flifecycle behavior before execution; use an isolated new project directory. `--skip-provision` is only a cloud-provisioning switch, not a sandbox or a guarantee of no local\u002Fnetwork side effects. Do not run a provisioning path until the intended Firebase project, region, billing and resource effects are authorized. Store `secret.txt` outside Git\u002Fsynced folders with owner-only permissions and no tracing; environment variables are not immune to child-process\u002Flog disclosure. Unset the secret after use and remove the temporary file once secure storage is verified.\n\n\nThere is no terminal to answer the wizard's questions in, so pass every answer as a flag:\n\n```bash\nIFS= read -r SHOPIFY_API_SECRET \u003C secret.txt  # Private file; disable tracing; no newline in the value\nexport SHOPIFY_API_SECRET\nnpx \"@mksd0398\u002Fnitrogen@${NITROGEN_VERSION:?Set the approved reviewed version}\" my-app \\\n  --api-key=CLIENT_ID \\\n  --project-id=PROJECT_ID \\\n  --firestore-region=us-central1 \\\n  --scopes=read_products,read_orders\n```\n\n| Flag | Use it when |\n|---|---|\n| `--create-project` | The Firebase project does not exist yet. |\n| `--shop=STORE.myshopify.com` | The app is for one store. |\n| `--language=javascript` | The user wants JavaScript. TypeScript is the default. |\n| `--region=REGION` | The functions should run somewhere other than next to Firestore. |\n| `--overwrite` | `my-app` exists and the user said to replace it. |\n| `--skip-provision` | A trial run that touches nothing in Firebase. For a real app, leave it out. |\n\nRun it from the parent folder; it creates `my-app\u002F`. It stops with exit code 1 when a flag is missing or the folder already has files, and says why. It never replaces the folder it runs from. `--no-deploy` and `--skip-shopify` belong to the interactive wizard and do nothing here.\n\nWhat it does: it creates Firestore and a Firebase web app (both only with `--firestore-region`), stores the secret in Secret Manager, installs dependencies, builds, runs `git init` and commits. It does not deploy, and \"All done\" means the scaffold is done.\n\nRead its output for these warnings. Run the commands from inside `my-app`.\n\n- **\"Firebase project … not found in your account\".** Either the project does not exist, so ask the user whether to create it (`firebase projects:create PROJECT_ID --display-name \"App name\"`), or they are signed in to another Google account (`firebase login:list`). Then set up Firebase by hand, as below.\n- **\"This project is on the Spark (free) plan\".** The user upgrades to Blaze. Then store the secret: `firebase functions:secrets:set SHOPIFY_API_SECRET --data-file=..\u002Fsecret.txt --project=PROJECT_ID`.\n- **\"Could not store the Client Secret\".** Run that same command once the project is on Blaze.\n\nWhen the setup was skipped, or stopped early, finish it by hand:\n\n```bash\nfirebase firestore:databases:create \"(default)\" --location=LOCATION --project=PROJECT_ID\nfirebase functions:secrets:set SHOPIFY_API_SECRET --data-file=..\u002Fsecret.txt --project=PROJECT_ID\n```\n\n### Step 3: Deploy and install\n\n```bash\ncd my-app\ncd functions && npm test && cd ..\nfirebase deploy --project PROJECT_ID\nshopify app deploy\n```\n\n`firebase deploy` ships the functions, the pages and the Firestore rules. `shopify app deploy` sends `shopify.app.toml` to Shopify: the app URL, scopes and webhook subscriptions. The user then installs the app from the Dev Dashboard onto a development store. `https:\u002F\u002FPROJECT_ID.web.app\u002Fauth?shop=STORE.myshopify.com` also works.\n\n### Step 4: Change an app\n\nFollow the app's `AGENTS.md`. These are the steps agents miss most:\n\n- **A new API** needs its file in `functions\u002Fsrc\u002Fapi\u002F`, an export in `functions\u002Fsrc\u002Findex`, and two rewrites in `firebase.json`. The rewrites use the lowercase export name and the same region as the others. `npm test` fails if the three disagree.\n- **A new scope** goes in `shopify.app.toml` and `functions\u002F.env`, then needs `shopify app deploy`. Merchants approve it the next time they open the app.\n- **Orders and customers** are protected customer data. The user selects the data the app uses in the Partner Dashboard, under the app's API access; apps made in the Dev Dashboard are listed there too. Until then, Shopify refuses order and customer webhooks, even on a development store.\n- **A new Firestore collection** is keyed by `tenantId(ctx.app, ctx.shop)` and listed in `TENANT_DOCS` or `TENANT_FIELD` in `functions\u002Fsrc\u002Fwebhooks`. That way `shop\u002Fredact` deletes it.\n- **A new page** needs its link added to the `\u003Cs-app-nav>` of every page, because each page carries its own copy.\n- **A new webhook topic** reaches the app only after `shopify app deploy`.\n\nRun `cd functions && npm test` after every change, and before every deploy.\n\n## Examples\n\n### Example 1: A one-store JavaScript app on a new Firebase project\n\nThe user gave the client ID, a new project id, their store and the location `europe-west1`, and saved the secret to `secret.txt`. The feature reads orders.\n\n```bash\nIFS= read -r SHOPIFY_API_SECRET \u003C secret.txt  # Private file; disable tracing; no newline in the value\nexport SHOPIFY_API_SECRET\nnpx \"@mksd0398\u002Fnitrogen@${NITROGEN_VERSION:?Set the approved reviewed version}\" my-app \\\n  --api-key=CLIENT_ID \\\n  --project-id=PROJECT_ID \\\n  --create-project \\\n  --shop=STORE.myshopify.com \\\n  --language=javascript \\\n  --firestore-region=europe-west1 \\\n  --scopes=read_products,read_orders\n```\n\nOrders are protected customer data: Shopify refuses order webhooks until the user selects that data in the Partner Dashboard.\n\n### Example 2: Add an API resource\n\n1. Create `functions\u002Fsrc\u002Fapi\u002F\u003Cname>.ts`, starting from `functions\u002Fsrc\u002Fapi\u002Fstatus.ts`. A route returns the JSON to send, or throws `HttpError(status, message)`.\n2. Export it from `functions\u002Fsrc\u002Findex.ts`.\n3. Add rewrites for `\u002Fapi\u002F\u003Cname>` and `\u002Fapi\u002F\u003Cname>\u002F**` to `firebase.json`. `serviceId` is the export name in lowercase; `region` is the same as the other rewrites.\n4. Add tests next to `functions\u002Ftest\u002Fapi.test.js`, which shows how to sign a session token and stub Shopify.\n\n```bash\ncd functions && npm test && cd ..\nfirebase deploy --project PROJECT_ID\n```\n\n### Example 3: Add a webhook\n\n1. Subscribe in `shopify.app.toml` with a `[[webhooks.subscriptions]]` block, using the same `uri` as the others.\n2. Handle its topic in the `switch` in `functions\u002Fsrc\u002Fwebhooks.ts`. Answer within 5 seconds.\n3. Deploy the function, then send the subscription to Shopify:\n\n```bash\nfirebase deploy --only functions:webhooks\nshopify app deploy\n```\n\n## Best Practices\n\n- ✅ Read the app's `AGENTS.md` before changing it.\n- ✅ Take the shop and the app from what was verified, `ctx.shop` and `ctx.app`, never from a request's body, query or headers.\n- ✅ Treat a missing signature, session token or body as a refusal.\n- ✅ Keep the client secret only in Secret Manager, and in `functions\u002F.secret.local` for the emulator, which git ignores.\n- ✅ Reach Firestore only through functions, and keep `firestore.rules` denying every client.\n- ✅ Run `cd functions && npm test` after every change, and before every deploy.\n- ❌ Don't use Polaris React or `@shopify\u002Fapp-bridge-react`.\n- ❌ Don't loosen any check in `functions\u002Fsrc\u002Fverify`.\n- ❌ Don't invent the client ID, the secret or the Firebase project, and don't ask for the secret in the chat.\n\n## Deployment and data checks\n\nBefore any authorized deploy, inspect the actual generated source and dependencies, not just scaffold success. Test invalid\u002Fexpired\u002Fwrong-audience tokens, raw-body webhook HMAC, replay\u002Fidempotent webhook handling, cross-tenant reads\u002Fwrites and redaction coverage. Verify JWT signature, issuer, audience, time claims and tenant binding server-side; deny-client Firestore rules do not constrain Admin SDK code. Public invocation allows requests to reach the verifier; it is never a replacement for authentication. Confirm requested app\u002Fproject\u002Fstore and preserve existing resources. Tests passing does not independently prove these properties or authorize deployment.\n\n## Limitations\n\n- Cloud Functions and Secret Manager need the Blaze plan. Only the user can upgrade the project.\n- Authentication requires a supported interactive host\u002Fbrowser flow; do not guess account identity or expose credentials.\n- The Firestore location cannot be changed after it is created.\n- Shopify refuses order and customer webhooks until the user selects protected customer data in the Partner Dashboard.\n- Hosting ends a rewritten request at 60 seconds, whatever `timeoutSeconds` says.\n- Apps made before Nitrogen 3.4 have no `AGENTS.md`; use [references\u002Fapp-guide.md](references\u002Fapp-guide.md) for them.\n- Stop and ask when a value only the user can give is missing.\n\n## Security & Safety Notes\n\n- The scaffold changes the user's Firebase project: with `--firestore-region` it creates Firestore and a Firebase web app, and it stores the client secret in Secret Manager. `--create-project` and `firebase projects:create` create a project; use them only with the user's go-ahead. `--skip-provision` is a trial run that touches nothing in Firebase.\n- `firebase deploy --project PROJECT_ID` ships functions, pages and Firestore rules to the live project, and `shopify app deploy --allow-updates` sends the URL, scopes and webhook subscriptions to Shopify. Run them when the user has asked for a deploy, after `npm test` passes.\n- Do not add Firebase `--force`: it can suppress function-deletion confirmation. Inventory existing resources and use `--only` for the intended functions\u002Fhosting\u002Frules where possible, with the explicit target project. Review deletions before deployment.\n- `--overwrite` replaces an existing `my-app` folder. Pass it only when the user said to replace it.\n- The secret is loaded through the process environment rather than a CLI argument. It may still be exposed by tracing, child processes or logs; restrict file permissions, avoid output and unset it after setup.\n- Use the approved pinned Nitrogen version; a package name\u002Fversion pin alone is not a review of its transitive dependencies.\n\n## Common Pitfalls\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| `There is no terminal to ask the setup questions in` | The wizard needs a terminal | Pass the flags in Step 2 |\n| `\"my-app\" already has files in it` | The folder exists | Use a new name, or `--overwrite` if the user agrees |\n| `Firebase project \"…\" not found in your account` | It does not exist yet, or the user is signed in to another account | Create it with the user's go-ahead, or check `firebase login:list`; then finish the setup by hand |\n| Deploy says billing or the Blaze plan is required | The project is on Spark | The user upgrades; then store the secret as in Step 2 |\n| The Dashboard says it could not load store information | `read_products` was dropped from the scopes | Put it back |\n| Deploy asks for `SHOPIFY_API_SECRET` | The secret was never stored | `firebase functions:secrets:set SHOPIFY_API_SECRET --data-file=..\u002Fsecret.txt` |\n| `\u002Fapi\u002Fx` answers 404 from Hosting | The export and rewrite disagree, or the regions do | `npm test` names the mismatch |\n| Google's 403 page instead of JSON | `invoker: \"public\"` was removed | Inspect Hosting\u002Ffunction invocation configuration and application authentication before any IAM\u002Fpublic-exposure change |\n| Every call answers 429 `Rate exceeded.` just after billing was enabled | Google is still applying billing | Wait; it has taken 25 minutes |\n| A GraphQL call says access denied | A scope is missing or not yet approved | Add it as in Step 4. If it persists, inspect the token\u002Finstallation state; do not delete sessions as a blind fix |\n| `shopify app deploy` refuses an order or customer webhook | Protected customer data is not selected | The user selects it in the Partner Dashboard |\n\n## Additional Resources\n\n- [Nitrogen on GitHub](https:\u002F\u002Fgithub.com\u002Fmksd0398\u002Fnitrogen) (MIT licence)\n- [`@mksd0398\u002Fnitrogen` on npm](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@mksd0398\u002Fnitrogen)\n- [Upstream skill](https:\u002F\u002Fgithub.com\u002Fmksd0398\u002Fnitrogen\u002Ftree\u002Fmaster\u002Fskills\u002Fshopify-firebase-app), also installable with `npx skills add mksd0398\u002Fnitrogen`\n- Bundled references, copied from the upstream skill: [Polaris web components](references\u002Fpolaris.md), [App Bridge](references\u002Fapp-bridge.md), [App guide](references\u002Fapp-guide.md)\n",{"name":5,"risk":31,"tags":47,"tools":50,"author":54,"source":33,"license":14,"category":40,"date_added":55,"description":7,"source_repo":56,"source_type":33,"license_source":57},[20,28,18,38,48,27,49],"firestore","app-bridge",[51,52,53,41,32],"claude","cursor","codex","mksd0398","2026-10-23","mksd0398\u002Fnitrogen","https:\u002F\u002Fgithub.com\u002Fmksd0398\u002Fnitrogen\u002Fblob\u002Fmaster\u002FLICENSE","main","7bf2279c8a65758319526a721d5c4b75683aec9c","skills\u002Fantigravity-shopify-firebase-app",3,"https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections","https:\u002F\u002Fgithub.com\u002Fboisenoise","2026-11-14 14:18:11",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add boisenoise\u002Fskills-collections --skill shopify-firebase-app",{"tool":71,"command":72},"bunx","bunx skills add boisenoise\u002Fskills-collections --skill shopify-firebase-app",{"tool":74,"command":75},"pnpm","pnpm dlx skills add boisenoise\u002Fskills-collections --skill shopify-firebase-app","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-shopify-firebase-app\u002FSKILL.md",true,[79,85,89],{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fapp-bridge.md","REFERENCE","参考文档",12923,"https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-shopify-firebase-app\u002Freferences\u002Fapp-bridge.md",{"path":86,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fapp-guide.md",5889,"https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-shopify-firebase-app\u002Freferences\u002Fapp-guide.md",{"path":90,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fpolaris.md",21105,"https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-shopify-firebase-app\u002Freferences\u002Fpolaris.md",[94,103,111,120,128,136],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":98,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":102},"01M7B6HREHB53EHGGVZND7DDXN","scrapely-scrape","Collect web data with ready-made Scrape.ly scrapers: Google Maps places, Amazon products, LinkedIn jobs, reviews, social posts. Use when the user wants structured data from a site.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":102},"01M7B6GDNNN4HE662KA6KPF7GW","lumify-odds","Lumify's hosted sports MCP\u002FREST API for sportsbook odds, line-movement history, public betting splits, and player props across MLB, NFL, NBA, NHL, soccer, tennis, NCAAF, NCAAB. Read-only market data.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":115,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":119},"01M743PZMJW2GEKG5J199GPSK7","sync-lipsync","Lip-sync an existing video of a real person to new audio or a typed script with sync. labs through its hosted MCP server, quoting the cost and waiting for approval first.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":124,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":119},"01M743MMN3CKTJVNRSZMB684E5","music-for-robots","Optional music-inspired creative exercise for multimodal agents. Ingests an unquantized acoustic MP3 composition by Michael Luchtan (Music For Robots) into a private temporary directory, analyzing microtiming and texture to inspire creative writing, brainstorming, or technical tasks.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FSKILL.md",[],[],{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":132,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":119},"01M743KC2GN5WE11BSTWSSWD8B","imagera-media","Generate or edit images, video clips, voiceovers and music through the hosted Imagera MCP server, quoting the credit cost and getting approval before each paid call.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FSKILL.md",[],[],{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":140,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":119},"01M743HDJNZQA8A4VT68NWGWQJ","deja-history","Search this machine's past AI coding sessions across Claude Code, Codex, Cursor, Gemini CLI and thirty-nine other agents before editing, debugging, or denying something exists.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FSKILL.md",[],[]]