FG
๐Ÿ”Œ APIs & SDKsStripe

[Feature] Strongly Typed Event Type for Stripe.Event

Freshover 2 years ago
Mar 14, 20260 views
Confidence Score79%
79%

Problem

Not too important, but it would be nice if this type: https://github.com/stripe/stripe-node/blob/02da7dc2c5edae280aaf5e3566f3b7b383024371/types/2020-03-02/Events.d.ts#L52 is strongly typed with all possible events. This would help catch bugs within switch statements or other logic statements, while also providing a nice menu of events within your IDE. If you are open to it, I don't mind making a quick script to take the webhook dropdown and convert it to a type definition for this variable in a PR.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
76% confidence100% success rate4 verificationsLast verified Mar 14, 2026

Solution: [Feature] Strongly Typed Event Type for Stripe.Event

Low Risk

There's a quick workaround for this. Add this to a declaration or any ts file imported in your project: [code block] Then use `Stripe.TypedEvent<Stripe.Subscription>` for example. This could easily be added to Stripe's official typing too.

76

Trust Score

4 verifications

100% success
  1. 1

    There's a quick workaround for this. Add this to a declaration or any ts file im

    There's a quick workaround for this. Add this to a declaration or any ts file imported in your project:

  2. 2

    Then use `Stripe.TypedEvent<Stripe.Subscription>` for example. This could easily

    Then use `Stripe.TypedEvent<Stripe.Subscription>` for example. This could easily be added to Stripe's official typing too.

Validation

Resolved in stripe/stripe-node GitHub issue #902. Community reactions: 5 upvotes.

Verification Summary

Worked: 4
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

stripepaymentsapifuturetype-definition