#alanac_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1212828163294363660
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!
When you switched to live mode you need to switch the webhook secret to match the one tied to your livemode webhook endpoint - I assume you originally were using the webhook secret created for your testmode endpoint, which wouldn't be the same
@tulip terrace Please respond here and not in other threads ๐
can you tell me where I can find this other secret? I'm currently using the key in the "signing secret".
here
Are you in live mode or test mode in the dashboard right now?
In live mode
Hmm... can you try logging the secret from your code and confirm it ends in "Ub8" ?
yes, that's right
That's after you log it from your code, right?
yes
Gotcha - can you give me more details on how you were testing earlier? Were you using the CLI?
Yes, until now, all my tests were done with the CLI, and there were never any problems with this, only when I moved to Vercel and started using it in production did this error appear. I don't know if there's some other detail I've overlooked, or if the point really is the key, because theoretically, you just have to change it to the live code key, right?
I've had some past vercel users that were having issues with the environment variables not correctly updating the the new secret, but if you've logged your key from your code and confirmed it's correct then that shouldn't be the issue
Yes, the Vercel already has the live mode key. If you have any other information that might help, I can send it to you
At this point, you need to do some debugging on your end - I'd recommend logging the full raw payload, signature, and webhook secret you pass through to the signature verification call so we can see if anything is wrong
Also if you can share what your signature verification code looks like that would help
Okay, I'll send you the code screenshots
one minute
below I'll make a switch case with the event types, would you like to see it too?
No, that's not necessary - I just need to see your signature verification code
I don't see you logging your webhook secret there
My webhook secret is in an env file, set in const webhookSecret, on line 17
Yes, but I asked you to log it from your code to make sure your code is pulling the correct secret
ooh, okay, I didn't understand, sorry
I don't know what I did differently now, I just added console.log to get the signature and secret of the webhook, and uploaded it to Vercel, and now it works. Finally some good news, I'm happier ๐
Anyway, I'll also try it out as you said, to confirm
hurray! I'm guessing vercel was looking at an outdated version of your environment variables (maybe you forgot to redeploy) and when you uploaded the changes to vercel it allowed the new values to kick in
hmm, that must have been it, I've been thinking about it for a while ๐
Anyway, thank you very much for your help
glad we could get that sorted out!
yeah \o