How to add GDPR Webhooks in remix Shopify app

Can anyone please tell me how to add GDPR Webhooks in Remix app?
I tried it but I couldn’t get any solution in it…

Hey @syedusama0786 - Did you ever work this out? I’m having the same issue and can’t find any answers!

yes i solve it by creating an end point in the routes folder.

The app must verify the authenticity of the request from Shopify. Expected HTTP 401 (Unauthorized), but got HTTP 404.

I got the above error, Can you please explain how you solved your problem? And if possible please share a code as well. Thank you

2 Likes

This is how I create an endpoint and add my code to it in remix Shopify template.

and this is how I add my endpoints in Partners account.

2 Likes

Okay, Thank you @syedusama0786 . No need to change the code in the “shopify.server.js” file, right? And write the same code for all files?

1 Like

yes

1 Like

As of this pull request on the shopify-app-js repo a few days ago the default setup for Webhooks.jsx in the remix app now returns a 200 for authenticated requests and a 401 otherwise.

This means the default remix template now behaves as it should for these requests (I think!)

1 Like

If you use Remix template. You can find it easily.
https://github.com/Shopify/shopify-app-template-remix/blob/main/app/routes/webhooks.tsx