You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -151,7 +151,7 @@ When you reach the step for [setting up environment variables](https://shopify.d
151
151
152
152
When hosting your Shopify Remix app on Vercel, Vercel uses a fork of the [Remix library](https://github.com/vercel/remix).
153
153
154
-
To ensure all global variables are set correctly when you deploy your app to Vercel update your app to use the Vercel adapter instead of the node adapter.
154
+
To ensure all global variables are set correctly when you deploy your app to Vercel update your app to use the Vercel adapter instead of the node adapter.
155
155
156
156
```diff
157
157
// shopify.server.ts
@@ -216,6 +216,7 @@ pnpm run deploy
216
216
217
217
This template registers webhooks after OAuth completes, using the `afterAuth` hook when calling `shopifyApp`.
218
218
The package calls that hook in 2 scenarios:
219
+
219
220
- After installing the app
220
221
- When an access token expires
221
222
@@ -228,7 +229,7 @@ That will force the OAuth process and call the `afterAuth` hook.
228
229
229
230
Webhooks subscriptions created in the [Shopify admin](https://help.shopify.com/en/manual/orders/notifications/webhooks) will fail HMAC validation. This is because the webhook payload is not signed with your app's secret key.
230
231
231
-
Create [webhook subscriptions]((https://shopify.dev/docs/api/shopify-app-remix/v1/guide-webhooks)) using the `shopifyApp` object instead.
232
+
Create [webhook subscriptions](https://shopify.dev/docs/api/shopify-app-remix/v1/guide-webhooks) using the `shopifyApp` object instead.
232
233
233
234
Test your webhooks with the [Shopify CLI](https://shopify.dev/docs/apps/tools/cli/commands#webhook-trigger) or by triggering events manually in the Shopify admin(e.g. Updating the product title to trigger a `PRODUCTS_UPDATE`).
234
235
@@ -251,6 +252,19 @@ When you trigger a webhook event using the Shopify CLI, the `admin` object will
251
252
252
253
Webhooks triggered by the CLI are intended for initial experimentation testing of your webhook configuration. For more information on how to test your webhooks, see the [Shopify CLI documentation](https://shopify.dev/docs/apps/tools/cli/commands#webhook-trigger).
253
254
255
+
### Using Defer & await for streaming responses
256
+
257
+
To test [streaming using defer/await](https://remix.run/docs/en/main/guides/streaming) during local development you'll need to use the Shopify CLI slightly differently:
258
+
259
+
1. First setup ngrok: https://ngrok.com/product/secure-tunnels
260
+
2. Create an ngrok tunnel on port 8080: `ngrok http 8080`.
261
+
3. Copy the forwarding address. This should be something like: `https://f355-2607-fea8-bb5c-8700-7972-d2b5-3f2b-94ab.ngrok-free.app`
262
+
4. In a separate terminal run `yarn shopify app dev --tunnel-url=TUNNEL_URL:8080` replacing `TUNNEL_URL` for the address you copied in step 3.
263
+
264
+
By default the CLI uses a cloudflare tunnel. Unfortunately it cloudflare tunnels wait for the Response stream to finish, then sends one chunk.
265
+
266
+
This will not affect production, since tunnels are only for local development.
267
+
254
268
## Benefits
255
269
256
270
Shopify apps are built on a variety of Shopify tools to create a great merchant experience.
0 commit comments