Replit Secrets Manager Can't Handle Stripe Webhook Secret?

So Replit Secret Manager has been great for every secret I have in my build, but every time I try to use a stripe webhook Secret it is always blocked and causes a 400 invalid event in Stripe. Has anyone dealt with this or have any recommendations?

Replit Secrets App/Tab: this is only used in Replit Dev mode so just enter your Stripe Test Keys. These secrets are not used in deployment.
Replit Deployments App/Tab: You will see an Edit Commands and Secrets button. Enter your Stripe Live Keys here. This is what will be packaged and deployed.
If you want to get sophisticated–ask Replit to allow you, as an admin, to set Live or Test mode for your app. Plug in both the Live and Test Stripe keys into the Secrets and Deployment App and it will use those secrets. Of course, make sure you’ve set Stripe to Test or Live to match. Finally, Replit got confused between PRICE and PRODUCT keys…in my case it needed PRICE, not PRODUCT.

2 Likes

This is exactly what I needed @tombice! I knew it was something I misunderstood, but I couldn’t figure out how Replit handled the separation between production and test keys and how it packed the production keys!

Glad that helped. After many hours (and $) of Replit troubleshooting I stumbled on the Commands and Secrets button and asked Replit the difference. It came back with a very clear response and the light bulb went on for me. I then asked it if this what would cause the issues, and it replied with a resounding “Yes.” Then I scolded it for not bringing this forward as a potential issue for the conflict sooner. Also, the Replit team could do a better job in the UI/UX to explain the difference. I’m sure it is documented somewhere but who RTFMs??? I’m vibe coding man!!! Below is a screen capture of the Payments configuration that I had Replit build in the Admin Dashboard for my app. I think there are some good clues here for how the Replit team could build a “payments module” that would allow users to navigate the complexities of incorporating and testing fake and live payments in dev and production.