#Ema.production-webhooks

1 messages · Page 1 of 1 (latest)

subtle prairie
#

Hey! So your webhook endpoint won't be reachable at a web address?

fathom schooner
#

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

subtle prairie
fathom schooner
#

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

subtle prairie
#

You can set that webhook to send events to the deployed address of the handler (whatever that is on AWS)

fathom schooner
subtle prairie
#

Yep, exactly!

fathom schooner
#

This is what I want to do?

subtle prairie
#

Note that the webhook signing secret will change from the CLI value, so be sure to update your environment variables in your project

fathom schooner
#

yeah, sure!

#

Do I need to select specific events I want to listen for, or will it default to everything?

subtle prairie
#

You'll need to select events, or you can select them all

#

I'd recommend only listening for the ones you need

fathom schooner
#

All I need to do in my code to move to the live webhook is replacing the secret, right?

subtle prairie
#

Otherwise your function will be getting invoked a lot

subtle prairie
#

CLI such a valuable tool for this

fathom schooner
#

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

subtle prairie
#

All those events you aren't listening to will still exist in your account logs, they just won't be sent to the webhook

fathom schooner
#

That's very clear! Thanks for the help!

subtle prairie
#

Np!

fathom schooner
#

I'm also learning more about how many useful events stripe has through this haha

subtle prairie
#

Pretty much an event for everything 🤯

fathom schooner
#

It is fixed and it now works without the CLI! Thank you very much

subtle prairie
#

Awesome!

fathom schooner
#

You can archive the thread if you have to :p