diff --git a/app/routes/webhooks.customers.data_request.tsx b/app/routes/webhooks.customers.data_request.tsx deleted file mode 100644 index eec17900..00000000 --- a/app/routes/webhooks.customers.data_request.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import type { ActionFunctionArgs } from "@remix-run/node"; -import { authenticate } from "../shopify.server"; - -export const action = async ({ request }: ActionFunctionArgs) => { - const { shop, payload, topic } = await authenticate.webhook(request); - - // Implement handling of mandatory compliance topics - // See: https://shopify.dev/docs/apps/build/privacy-law-compliance - console.log(`Received ${topic} webhook for ${shop}`); - console.log(JSON.stringify(payload, null, 2)); - - return new Response(); -}; diff --git a/app/routes/webhooks.customers.redact.tsx b/app/routes/webhooks.customers.redact.tsx deleted file mode 100644 index eec17900..00000000 --- a/app/routes/webhooks.customers.redact.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import type { ActionFunctionArgs } from "@remix-run/node"; -import { authenticate } from "../shopify.server"; - -export const action = async ({ request }: ActionFunctionArgs) => { - const { shop, payload, topic } = await authenticate.webhook(request); - - // Implement handling of mandatory compliance topics - // See: https://shopify.dev/docs/apps/build/privacy-law-compliance - console.log(`Received ${topic} webhook for ${shop}`); - console.log(JSON.stringify(payload, null, 2)); - - return new Response(); -}; diff --git a/app/routes/webhooks.shop.redact.tsx b/app/routes/webhooks.shop.redact.tsx deleted file mode 100644 index eec17900..00000000 --- a/app/routes/webhooks.shop.redact.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import type { ActionFunctionArgs } from "@remix-run/node"; -import { authenticate } from "../shopify.server"; - -export const action = async ({ request }: ActionFunctionArgs) => { - const { shop, payload, topic } = await authenticate.webhook(request); - - // Implement handling of mandatory compliance topics - // See: https://shopify.dev/docs/apps/build/privacy-law-compliance - console.log(`Received ${topic} webhook for ${shop}`); - console.log(JSON.stringify(payload, null, 2)); - - return new Response(); -}; diff --git a/shopify.app.toml b/shopify.app.toml index 090de333..3df7568a 100644 --- a/shopify.app.toml +++ b/shopify.app.toml @@ -5,30 +5,29 @@ scopes = "write_products" [webhooks] api_version = "2024-07" - # Mandatory compliance topics for public apps - # Delete only if the app is not public - # See: https://shopify.dev/docs/apps/build/privacy-law-compliance - [[webhooks.subscriptions]] - uri = "/webhooks/customers/data_request" - compliance_topics = [ "customers/data_request"] - - [[webhooks.subscriptions]] - uri = "/webhooks/customers/redact" - compliance_topics = [ "customers/redact" ] - - [[webhooks.subscriptions]] - uri = "/webhooks/shop/redact" - compliance_topics = [ "shop/redact" ] - - # When a shop uninstalls the app, delete the session for that shop + # Handled by: /app/routes/webhooks.app.uninstalled.tsx [[webhooks.subscriptions]] uri = "/webhooks/app/uninstalled" - topics = [ "app/uninstalled" ] + topics = ["app/uninstalled"] - # # For reference - # # Only receive webhooks for products with a price >= 10.00 - # # See: https://shopify.dev/docs/apps/build/webhooks/customize/filters + # Webhooks can have filters + # Only receive webhooks for products with a price >= 10.00 + # See: https://shopify.dev/docs/apps/build/webhooks/customize/filters # [[webhooks.subscriptions]] # topics = ["products/update"] # uri = "https://example.com/webhooks" # filter = "variants.price:>=10.00" + + # Mandatory compliance topics for public apps only + # See: https://shopify.dev/docs/apps/build/privacy-law-compliance + # [[webhooks.subscriptions]] + # uri = "/webhooks/customers/data_request" + # compliance_topics = ["customers/data_request"] + + # [[webhooks.subscriptions]] + # uri = "/webhooks/customers/redact" + # compliance_topics = ["customers/redact"] + + # [[webhooks.subscriptions]] + # uri = "/webhooks/shop/redact" + # compliance_topics = ["shop/redact"]