create-shopify-firebase-app 2.0.5 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,8 +11,9 @@ npx create-shopify-firebase-app my-app
11
11
  ```
12
12
 
13
13
  <p align="center">
14
- <img src="https://img.shields.io/badge/Shopify-2026--01-7AB55C?logo=shopify&logoColor=white" />
14
+ <img src="https://img.shields.io/badge/Shopify-2026--07-7AB55C?logo=shopify&logoColor=white" />
15
15
  <img src="https://img.shields.io/badge/Firebase-v2%20Functions-FFCA28?logo=firebase&logoColor=black" />
16
+ <img src="https://img.shields.io/badge/Node-22-339933?logo=nodedotjs&logoColor=white" />
16
17
  <img src="https://img.shields.io/badge/TypeScript-Functions-3178C6?logo=typescript&logoColor=white" />
17
18
  </p>
18
19
 
@@ -41,15 +42,18 @@ npx create-shopify-firebase-app my-app
41
42
 
42
43
  The **Firebase alternative** to `shopify app init`. Instead of Remix + Prisma + Vercel, you get:
43
44
 
44
- - **Firebase v2 Cloud Functions** (gen 2) — 4 independent, auto-scaling TypeScript functions
45
+ - **Firebase v2 Cloud Functions** (gen 2, Node 22) — 4 independent, auto-scaling functions
45
46
  - **Cloud Firestore** for sessions and app data (auto-scaling, free tier)
46
47
  - **Firebase Hosting** for your embedded admin dashboard (free)
47
- - **Vanilla HTML/JS + App Bridge** for the frontend (no React, no build step)
48
+ - **Polaris web components + App Bridge** 4 pages, no React, no build step
48
49
  - **Theme App Extension** for storefront UI (works on all Shopify plans)
49
- - **Shopify API 2026-01** (latest) — OAuth, session tokens, webhooks, GDPR handlers
50
- - **Production-ready** — deploy with one command, scale to millions
50
+ - **Shopify API 2026-07** — OAuth, session tokens, webhooks, GDPR handlers
51
+ - **Production-ready** — deployed and installable when the command finishes
51
52
 
52
- One `npx` command scaffolds everything, installs dependencies, wires up Firebase, and initializes git. You're ready to `firebase deploy`.
53
+ One command does the whole thing: signs you in to Shopify, creates the app, creates
54
+ and provisions the Firebase project, deploys it, and hands you an install link.
55
+ No copying Client IDs between dashboards, and no pasting your Client Secret — the
56
+ CLI reads it from the Shopify CLI itself.
53
57
 
54
58
  ---
55
59
 
@@ -57,11 +61,22 @@ One `npx` command scaffolds everything, installs dependencies, wires up Firebase
57
61
 
58
62
  ### Prerequisites
59
63
 
60
- | Tool | Install | Auto-installed? |
61
- |------|---------|----------------|
62
- | Node.js 18+ | [nodejs.org](https://nodejs.org/) | Required |
63
- | Firebase CLI | `npm i -g firebase-tools` | Yes, installed automatically if missing |
64
- | Shopify CLI | `npm i -g @shopify/cli` | Yes, installed automatically if missing |
64
+ The CLI checks all of these before it does anything, and offers to install what's missing.
65
+
66
+ | Tool | Install | Required? |
67
+ |------|---------|-----------|
68
+ | Node.js 20+ | [nodejs.org](https://nodejs.org/) | Yes Cloud Functions run on Node 22 |
69
+ | Firebase CLI | `npm i -g firebase-tools` | Yes — offered automatically if missing |
70
+ | Shopify CLI | `npm i -g @shopify/cli` | Yes — offered automatically if missing |
71
+ | git | [git-scm.com](https://git-scm.com/) | Optional — only for the initial commit |
72
+ | gcloud | [Cloud SDK](https://cloud.google.com/sdk) | Optional — auto-enables the Firestore API |
73
+
74
+ You also need a **Shopify Partner account** and a **Google account**. The CLI signs
75
+ you in to both; you don't need to open either dashboard first.
76
+
77
+ > **Cloud Functions require the Firebase Blaze plan.** It has a generous free tier
78
+ > (2M invocations/month), but a billing account must be attached. That is the one
79
+ > step the CLI cannot do silently for you.
65
80
 
66
81
  ### 1. Run the scaffold
67
82
 
@@ -69,86 +84,104 @@ One `npx` command scaffolds everything, installs dependencies, wires up Firebase
69
84
  npx create-shopify-firebase-app my-app
70
85
  ```
71
86
 
72
- The interactive CLI guides you through everything creating your Shopify app, setting up Firebase, and wiring it all together:
87
+ The CLI walks the entire flow. This is a real run:
73
88
 
74
89
  ```
75
90
  🛍️ + 🔥 create-shopify-firebase-app
76
- Serverless Shopify apps — free until you scale
77
-
78
- === App Configuration ===
79
-
80
- ? Project directory name: my-app
81
- ? App name (shown in Shopify admin): My App
82
- ? What kind of app are you building?
83
- Public app — list on the Shopify App Store
84
- Custom app — built for a single store
85
-
86
- === Shopify Setup ===
87
-
88
- ? How would you like to connect your Shopify app?
89
- Create a new app via Shopify CLI
90
- Link an existing app via Shopify CLI
91
- Enter credentials manually (Client ID + Secret)
92
-
93
- ℹ Logging into Shopify CLI...
94
- Logged into Shopify
95
- Creating a new Shopify app...
96
- (Shopify CLI handles app creation interactively)
97
- ✔ Client ID: abc123...
98
- ? Paste your Client Secret: ********
99
- ? What API access does your app need?
100
- Read products read_products
101
- Read + write products read_products,write_products
102
- Orders + products read_products,write_products,read_orders,write_orders
103
- Custom scopes — enter manually
91
+
92
+ === Environment Check ===
93
+
94
+ ✔ Node.js v22.20.0
95
+ npm 10.9.4
96
+ git 2.47.1
97
+ Firebase CLI 15.10.0
98
+ Shopify CLI 4.6.0
99
+ gcloud 565.0.0
100
+ ✔ Environment ready
101
+
102
+ === Sign In to Shopify ===
103
+
104
+ A browser window opens approve the code shown below.
105
+ Signed in to Shopify
106
+
107
+ === Choose Your Template ===
108
+
109
+ ? What would you like to create?
110
+ Shopify + Firebase app (full-stack serverless)
111
+ Extension-only app (Shopify CLI)
112
+
113
+ === Project Setup ===
114
+
115
+ ? Language for Cloud Functions › TypeScript
116
+ ? App name (shown in Shopify admin) › My Store App
117
+ ? What API access does your app need? › read_products
118
+
119
+ === Scaffolding ===
120
+
121
+ ✔ Created 33 files in my-store-app/
122
+
123
+ === Create Your Shopify App ===
124
+
125
+ (the Shopify CLI asks which organization, and lets you create a new app)
126
+ ✔ Client ID: 12dfc4d0d6d0b40d85b0f64b80de28af
127
+ ✔ Client Secret: shpss_09**************(38 chars)
104
128
 
105
129
  === Firebase Setup ===
106
130
 
107
- Fetching your Firebase projects...
131
+ ? Which Google account should own this project? › you@gmail.com
108
132
  ? Select a Firebase project
109
133
  ❯ [create a new project]
110
134
  My Project (my-project-123)
111
- Another Project (another-456)
135
+ [add Firebase to an existing Google Cloud project]
112
136
  [enter project ID manually]
113
137
 
114
- === Setting Up ===
138
+ Firestore: us-central1
139
+ ✔ Web App: My Store App
140
+ ✔ Hosting: https://my-store-app.web.app
141
+ ✔ Artifact cleanup policy set — 'firebase deploy' will not prompt
142
+ ✔ App config written — https://my-store-app.web.app
143
+
144
+ === Installing & Building ===
115
145
 
116
- ℹ Scaffolding project...
117
- ✔ Created 27 files in my-app/
118
- ℹ Installing dependencies...
119
146
  ✔ Dependencies installed
120
- ℹ Building TypeScript...
121
147
  ✔ TypeScript compiled successfully
122
- ℹ Setting up Firebase...
123
- Firebase project linked + Firestore provisioned
124
- ℹ Checking Shopify CLI...
125
- Shopify CLI detected
126
- Initializing git...
127
- ✔ Git repository initialized with first commit
148
+
149
+ === Going Live ===
150
+
151
+ Deployed to Firebase
152
+ Shopify app updated
128
153
 
129
154
  ✔ All done! Your Shopify + Firebase app is ready.
130
155
 
131
- Next steps:
156
+ Your app is live. Install it on a dev store:
132
157
 
133
- cd my-app
134
- firebase deploy
158
+ https://my-store-app.web.app/auth?shop=YOUR-STORE.myshopify.com
135
159
  ```
136
160
 
137
- No need to visit Firebase Console or Shopify Partner Dashboard beforehand the CLI guides you through everything.
161
+ **You never paste the Client Secret.** The CLI reads it from `shopify app env show`
162
+ once the app exists — which is exactly why the Shopify app is created *before* Firebase.
138
163
 
139
- ### 4. Deploy & Install
164
+ ### 2. Install it on a development store
140
165
 
141
- ```bash
142
- cd my-app
143
- firebase deploy
144
- ```
166
+ The command prints an install link when it finishes. Open it in a browser with your
167
+ store's domain substituted in:
145
168
 
146
- Then install on your dev store by visiting:
147
169
  ```
148
- https://my-app-12345.web.app/auth?shop=YOUR-STORE.myshopify.com
170
+ https://YOUR-PROJECT.web.app/auth?shop=YOUR-STORE.myshopify.com
171
+ ```
172
+
173
+ Approve the scopes and the app opens embedded in the Shopify admin.
174
+
175
+ ### 3. Make changes
176
+
177
+ ```bash
178
+ cd my-store-app
179
+ # edit web/ or functions/src/
180
+ firebase deploy --force
149
181
  ```
150
182
 
151
- Or use Shopify CLI for local development:
183
+ Or develop against a Shopify tunnel with hot reload:
184
+
152
185
  ```bash
153
186
  shopify app dev
154
187
  ```
@@ -165,11 +198,11 @@ Most Shopify app developers pay for hosting before they even have users. With Fi
165
198
  |---|---|---|
166
199
  | **Backend** | Remix server (monolith) | Firebase v2 Cloud Functions (4 independent functions) |
167
200
  | **Database** | Prisma + PostgreSQL | Cloud Firestore (NoSQL, auto-scaling) |
168
- | **Frontend** | React + Polaris | Vanilla HTML/JS + App Bridge |
201
+ | **Frontend** | React + Polaris | Polaris web components + App Bridge (no build) |
169
202
  | **Hosting** | Vercel / Fly.io / Heroku | Firebase Hosting (free tier) |
170
- | **Auth** | `@shopify/shopify-app-remix` | Manual OAuth (140 lines, you own it) |
203
+ | **Auth** | `@shopify/shopify-app-react-router` | Manual OAuth (~150 lines, you own it) |
171
204
  | **Build** | Webpack / Vite | `tsc` (TypeScript compiler, no bundler) |
172
- | **Deploy** | Varies | `firebase deploy` (one command) |
205
+ | **Deploy** | Varies | Done for you the CLI deploys before it exits |
173
206
  | **Cost** | $5-25/month from day one | **$0/month** — free until you scale |
174
207
  | **Framework knowledge** | Remix + React required | Express + HTML (that's it) |
175
208
  | **Scaling** | Single server | Per-function auto-scaling (Cloud Run) |
@@ -197,7 +230,7 @@ Most Shopify app developers pay for hosting before they even have users. With Fi
197
230
 
198
231
  ```
199
232
  my-app/
200
- ├── shopify.app.toml # Shopify app config (API 2026-01)
233
+ ├── shopify.app.toml # Shopify app config (API 2026-07)
201
234
  ├── firebase.json # Firebase Hosting + Functions + Firestore
202
235
  ├── firestore.rules # Security rules (blocks direct client access)
203
236
 
@@ -213,10 +246,14 @@ my-app/
213
246
  │ │ └── config.ts # Environment config
214
247
  │ └── .env # Your secrets (auto-generated, git-ignored)
215
248
 
216
- ├── web/ # ── Frontend ──
217
- │ ├── index.html # Embedded admin dashboard
218
- │ ├── js/bridge.js # App Bridge helper (auth, fetch, navigate)
219
- └── css/app.css # Shopify-like styles
249
+ ├── web/ # ── Frontend (4 pages) ──
250
+ │ ├── index.html # Dashboard
251
+ │ ├── products.html # Product search + detail
252
+ ├── settings.html # Form persisted to Firestore
253
+ │ ├── polaris.html # Polaris component reference
254
+ │ ├── js/app.js # App Bridge helper (idToken, apiFetch, toast)
255
+ │ ├── js/pages/ # One module per page
256
+ │ └── css/app.css # Supplementary styles
220
257
 
221
258
  └── extensions/ # ── Storefront ──
222
259
  └── theme-block/
@@ -285,11 +322,18 @@ npx create-shopify-firebase-app
285
322
  # With project name
286
323
  npx create-shopify-firebase-app my-app
287
324
 
325
+ # Skip the deploy steps (scaffold only)
326
+ npx create-shopify-firebase-app my-app --no-deploy
327
+
328
+ # Auto-install any missing CLI tools without asking
329
+ npx create-shopify-firebase-app my-app --yes
330
+
288
331
  # Non-interactive (CI/CD)
289
332
  npx create-shopify-firebase-app my-app \
290
333
  --api-key=abc123 \
291
334
  --api-secret=secret \
292
335
  --project-id=my-firebase-project \
336
+ --create-project \
293
337
  --scopes=read_products,write_products
294
338
 
295
339
  # Help
@@ -509,9 +553,13 @@ These are **required** for Shopify App Store listing.
509
553
  |---------|----------|
510
554
  | "Missing shop parameter" | Set **App URL** in Partner Dashboard to `https://PROJECT_ID.web.app` |
511
555
  | "HMAC verification failed" | Check `SHOPIFY_API_SECRET` in `functions/.env` |
512
- | "Invalid session token" | Verify `data-api-key` in `web/index.html` matches your API key |
556
+ | "Invalid session token" | Check `SHOPIFY_API_SECRET` in `functions/.env` the JWT is signed with it |
513
557
  | Functions not receiving requests | Check `firebase.json` rewrites match function export names in `index.ts` |
514
558
  | Webhook failures | Must respond 200 within 5 seconds. Check `firebase functions:log` |
559
+ | `firebase deploy` exits 1 on a new project | Use `firebase deploy --force` — a bare deploy stalls on the artifact-policy prompt and leaves Hosting unreleased |
560
+ | Firestore create fails with 403 | The Firestore API is not enabled yet: `gcloud services enable firestore.googleapis.com --project=YOUR_ID` |
561
+ | `App name cannot contain "Shopify"` | Shopify rejects those names — pick another (the CLI now strips it automatically) |
562
+ | `shopify app deploy` says "not a member of the organization" | The app was created under a different Shopify account. Run `shopify auth login` |
515
563
  | Individual function not deploying | Ensure export name in `index.ts` matches function name in `firebase.json` rewrite |
516
564
 
517
565
  ---