Comments (13)
Hey @dnlmzw,
I ran into a similar problem with a client and after a bunch of research found this tool called hookdeck which allows you to queue/throttle webhooks.
All I had to do was change out the webhook urls from my own api endpoint to one they give. From there I set a rate limit of 2 per second to the /api/shopify/product-update endpoint, and it seems like it's working fine for now! There's a free plan of 10,000 events per month.
from hull.
@j4ysen What a lovely solution. Would love to have this built in at some point, but it also feels like quite some work to build something that works reliably (which I don't have time for with this client), so will definitely check out hookdeck. 10K events also seems reasonable.
from hull.
@j4ysen I've now had time to test it out and it works like a charm! Had to set the limit to 1 sec though, since 2 seconds was apparently still close enough for it to trigger the rate limiting — Also, having the interface to retry failed calls, and having that general overview is such a great feature.
@ndimatteo I'll leave it up to you to decide whether this is solved or not. Maybe adding it to the documentation could be useful :)
from hull.
Here's my final working setup in case anyone wonders in the future:
Remember to turn on "rate limiting"
from hull.
Hi folks, I'm one of the creators of hookdeck. It was rewarding to read about your experience. I wanted to jump in to contribute a bit more and offer help!
First of all, you can check out our cli, a free alternative to ngrok with a permanent URL (amongst other things). It almost mimics the behaviour of Hookdeck for what you are ready to go to production, you'll just need to add a destination URL.
@djclarkson The
/api/shopify/*
endpoints seem to be defined here. When you add the Hookdeck URL to Shopify, you don't need to append your server path to the path. That could be leading to 404. Your URL would behttps://events.hookdeck.com/e/src_YOUR_ID
and nothttps://events.hookdeck.com/e/src_YOUR_ID/api/shopify/...
. Happy to help debug if you reach out in the dashboard live chat!One more thing, all though this might not be obvious, people tend to prefer using a single Hookdeck URL. You can create a unique
shopify
source and send all your webhooks to it. Using the filters, you can then forward to the right webhooks to the right URL. Optional but some prefer this approach. It would look like this:@ndimatteo All of this configuration can also be automated, would there be interest in baking methods to configure the webhooks within the repo? I could find some time to work on it and open a PR if there is interest :)
Very cool product! Going to keep a close eye on my logs. Will def use this if I hit rate limits.
Edit: Scratch that, this looks awesome. Going to move some of my webhooks to Hookdeck. I like that it keeps a record of webhooks. ❤️
from hull.
Hey @dnlmzw!
Great catch here. You're right, that some sort of Queue would be one way to help spread updates out so you don't hit the limit. The other is (as suggested in the link you shared) is to up your limit by moving to Shopify Plus.
I don't have plans at the moment for a built-in Queue to handle this, but if you (or anyone else) has ideas/solutions, feel free to submit a PR!
from hull.
Here's my final working setup in case anyone wonders in the future:
Thanks for the explanation, this is a great solution.
from hull.
Thanks for sharing this. I tried this but got error code 500 when trying to connect to my vercel domain (the CNAME is successfully validated). When do those /api/shopify/ API endpoints get created? I wonder if I am missing a step.
from hull.
@djclarkson
Is the site already deployed? If you're able to get the url to work in shopify notifications webhooks (as per the hull readme instructions), you should be able to add it to hookdeck
from hull.
Thanks @j4ysen yes site was deployed. I got error 500s for product-delete and product-update and 404 for product-create. but haven't had a chance to look further.
from hull.
I have previously used ngrok to set up a local server that I pointed my Shopify hooks to. You'll then be able to see errors in your CLI, and can therefore debug it a bit faster.
from hull.
Hi folks, I'm one of the creators of hookdeck. It was rewarding to read about your experience. I wanted to jump in to contribute a bit more and offer help!
First of all, you can check out our cli, a free alternative to ngrok with a permanent URL (amongst other things). It almost mimics the behaviour of Hookdeck for what you are ready to go to production, you'll just need to add a destination URL.
@djclarkson The /api/shopify/*
endpoints seem to be defined here. When you add the Hookdeck URL to Shopify, you don't need to append your server path to the path. That could be leading to 404. Your URL would be https://events.hookdeck.com/e/src_YOUR_ID
and not https://events.hookdeck.com/e/src_YOUR_ID/api/shopify/...
. Happy to help debug if you reach out in the dashboard live chat!
One more thing, all though this might not be obvious, people tend to prefer using a single Hookdeck URL. You can create a unique shopify
source and send all your webhooks to it. Using the filters, you can then forward to the right webhooks to the right URL. Optional but some prefer this approach. It would look like this:
@ndimatteo All of this configuration can also be automated, would there be interest in baking methods to configure the webhooks within the repo? I could find some time to work on it and open a PR if there is interest :)
from hull.
@alexbouchardd so sorry I didn't see your follow-up on this! Great job with hookdeck and for explaining alternative solutions for this to HULL users!
I'd love to see what an automated approach looks like, feel free to submit a PR for something like that whenever you'd like 😃
from hull.
Related Issues (20)
- Is it true that you have to redeploy every time a product is added? HOT 4
- Sanity CLI v3 causes project to not work correctly HOT 1
- GBP Cart Subtotals
- Sanity not connecting to Storefront HOT 2
- Products not appearing in Sanity—how to bring them over? HOT 1
- Bundles created with the Shopify App (Summer 2023) can't be added to cart HOT 11
- Mobile Crashes When Interacting On Page HOT 6
- marketing starter upgrade packages HOT 1
- Client-side exception HOT 7
- unknown field found
- Sync seems inconsistent HOT 1
- Can't locate Sanity Starter HOT 1
- Not able to Import Shopify Products into sanity Studio
- Application error: a client-side exception has occurred (see the browser console for more information). HOT 2
- Issue cloning project from Vercel HOT 1
- TypeError: Cannot read properties of undefined (reading 'replace') HOT 2
- I got the same error after following the directions. I cloned the repository with git clonee and followed the instructions in the ReadMe.md file in the root. Localhost:3333 and localhost:3000 are running, I don't see any errors. HOT 2
- Tried deploying Hull from Vercel Interface. HOT 1
- Sanity Create Project is not working HOT 1
- @reach/rect error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hull.