NNitrogen

Ship a Shopify app on Firebase in one command.

Nitrogen creates the app, deploys it, and hands you an install link. Nothing runs while nobody is using it, so an idle app costs nothing.

$npx @mksd0398/nitrogen my-app
  • Open source, MIT. Use it for client and commercial apps.
  • No framework, no server. Plain HTML and Cloud Functions.
  • Tested. Every project ships with its own test suite.
$ npx @mksd0398/nitrogen my-app

✔ Signed in to Shopify
✔ Client ID and secret read from the CLI
✔ Firestore: europe-west1
✔ Functions region: europe-west1
✔ Client Secret stored in Secret Manager
✔ Deployed to Firebase
✔ Shopify app updated

✔  All done! Your app is ready to install.

Cost calculator

Will your app be free to run?

Firebase's Blaze plan is pay-as-you-go with a free allowance every month. Enter how your app would be used to see whether it fits, and what it costs if it does not.

$0 a month. Inside the free tier.

An estimate at Google's US list prices for a 256 MiB function. It bills every call as if it had an instance to itself, so real usage at volume is lower. Regions differ; check the Cloud Run and Firestore pricing pages.

How it works

From nothing to an installable app

You answer a few questions. The command does the rest, and stops to tell you if something needs your attention.

  1. Creates the Shopify appYour client id and secret are read from the Shopify CLI. You never paste them.
  2. Provisions FirebaseFirestore, Hosting and Functions, in the region you choose.
  3. Locks away the secretIt goes to Secret Manager, never into a file that ships with your code.
  4. Deploys and registersThe live URLs are sent to Shopify. The app is ready to install.

What you get

The parts that take weeks to get right

A working app you can read end to end, in TypeScript or JavaScript.

Installs the way Shopify installs

Works from the App Store or the admin with no install link. Uninstall and reinstall are handled.

Verification that fails closed

Webhooks, session tokens, the App Proxy and OAuth refuse a request when a signature is missing, not only when it is wrong.

One function per API resource

Each scales, times out and deploys on its own, so a slow import cannot starve the routes merchants are waiting on.

Single- or multi-tenant

Lock the app to one store, open it to many, or run several Shopify apps on one backend.

API keys for outside callers

Let a mobile app or a script call your API. Keys are hashed at rest, scoped, and owned by one store.

Rate limits and a spending cap

A per-caller request limit, Shopify's own throttling passed through, and a ceiling on instances.

A reference inside your app

All 50 Polaris web components and all 26 App Bridge APIs, each with a working example to copy.

Tests included

A test suite that needs no emulator or network. It also checks your routes match your deploy config.

GDPR webhooks wired up

The three mandatory webhooks are subscribed and verified, with shop data deletion implemented.

Developer experience

Adding an API is a few lines

A route is one entry in a table. Authentication, rate limiting, routing and errors are handled before your code runs.

// functions/src/api/orders.ts
export default endpoint({
  "GET /api/orders": async (ctx) => {
    const data = await graphql(ctx,
      `{ orders(first: 10) { nodes { id name } } }`);
    return { orders: data.orders.nodes };
  },

  "GET /api/orders/:id": async (ctx) => {
    // ctx.shop comes from the verified token,
    // never from the request
    return { id: ctx.params.id, shop: ctx.shop };
  },
});

// functions/src/index.ts
export const orders = onRequest(base, ordersApi);
  • Return the JSON to send, or throw an HttpError. Anything else becomes a 500 whose detail stays in the logs.
  • index is the whole API surface. If a function is not exported there, it does not exist.
  • Open a route to API keys with { apiKey: "read" }, or to the storefront with { auth: "proxy" }.
  • npm test fails if an export and its rewrite in firebase.json disagree, before you deploy.

Choosing

Nitrogen or the official template

Shopify's own template is built on React Router. Both are good choices, for different apps.

Official templateNitrogen
BackendOne React Router serverCloud Functions, one per API resource
DatabasePrisma with SQLCloud Firestore
FrontendReactPolaris web components, no build step
When idleA server stays onNothing runs
DeployYou choose and set up a hostDone by the command
Best forRich admin interfaces, teams already on ReactCustom apps, small public apps, teams on Google Cloud

Questions

Before you run it

The things people ask first.

Do I need a credit card?

Yes. Cloud Functions and Secret Manager need Firebase's Blaze plan, which needs a billing account. You are only charged for what goes beyond the free allowance, and the calculator above shows where that is. Set a budget alert on day one: Firebase alerts, it does not cap.

Can I list the app on the Shopify App Store?

Installing from the App Store works. Passing review is your job: a paid app needs Shopify's billing API, and if you store customer data you must write the export and delete logic for the privacy webhooks. Choose "Many stores" when the wizard asks who the app is for.

Do I have to know React?

No. The pages are plain HTML using Polaris web components, with no build step. If your admin interface needs React and client-side state, the official template is the better fit.

What do I need installed?

Node.js 20 or newer. The command checks for the Firebase CLI and the Shopify CLI and offers to install them. You also need a Shopify Partner account and a Google account.

Can I use it for client work or a commercial app?

Yes. Nitrogen is MIT licensed, and the app it generates is yours.

What happens when traffic spikes?

Each function scales on its own, up to a ceiling of 10 instances that you can raise. The ceiling is a spending cap: a retry storm cannot turn into an unbounded bill.

Is this made by Shopify?

No. Nitrogen is an independent community project, not affiliated with or endorsed by Shopify or Google.

Run it, and have an app to install.

One command. The quick start covers the prerequisites and a full run of the wizard.

$npx @mksd0398/nitrogen my-app