#Ema.production-webhooks
1 messages · Page 1 of 1 (latest)
Hey! Our webhook endpoint is reachable, what I'm missing is the Stripe CLI part
I have a /webhook API where the CLI currently forwards the events to
looks like this, rest of the code is redacted because business logic
Ah ok. Yeah so you'll need to create a live webhook in your Dashboard: https://dashboard.stripe.com/webhooks
What I did in dev environment for testing was firing up the stripe cli, logging into my account and doing stripe listen --forward-to url
You can set that webhook to send events to the deployed address of the handler (whatever that is on AWS)
so if my webhook API is https://domain.com/payments/webhook I point it to that address, correct?
Yep, exactly!
This is what I want to do?
Note that the webhook signing secret will change from the CLI value, so be sure to update your environment variables in your project
yeah, sure!
Do I need to select specific events I want to listen for, or will it default to everything?
You'll need to select events, or you can select them all
I'd recommend only listening for the ones you need
All I need to do in my code to move to the live webhook is replacing the secret, right?
Otherwise your function will be getting invoked a lot
Yep, should be. If it was working with the CLI then it should be seamless
CLI such a valuable tool for this
All the events I am not listening to won't be rejected at a Stripe level, right?
Like, if I do not listen for customer.create events on my webhook they will still be executed fine
All those events you aren't listening to will still exist in your account logs, they just won't be sent to the webhook
That's very clear! Thanks for the help!
Np!
I'm also learning more about how many useful events stripe has through this haha
Pretty much an event for everything 🤯
It is fixed and it now works without the CLI! Thank you very much
Awesome!
You can archive the thread if you have to :p