FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
charmaine
charmainecancelledStripeSubscriber
Remix of stevekrouse/newStripeSubscriber
Public
Like
cancelledStripeSubscriber
Home
Code
2
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
main.tsx
https://charmaine--34a54416252311f0b0e0569c3dd06744.web.val.run
README.md

Cancelled Stripe Subscription Handler

This val processes cancelled Stripe subscribers to Val Town Pro. It sends our team a Discord notification. It takes a couple of steps if you'd like to set up something similar for your own Stripe account.

Setup

  1. Fork this HTTP val
  2. Create a new webhook in Stripe
  3. Add your val's HTTP endpoint URL into the Stripe webhook
  4. Select customer.subscription.cancelled as the only event to listen to (more on this below)
  5. Add your stripe_sk_customer_readonly to your Val Town Env Variables
  6. Add your webhook's signing secret as STRIPE_WEBHOOK_SECRET to you Val Town Env Variables

How the code is structured

  1. Verifies the signature to make sure it's really from Stripe
  2. Sends off the Discord message
HTTP
  • main.tsx
    charmaine--34…44.web.val.run
Code
README.md
H
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.