Stripe v22.3.1 breaking change: HttpClient and HttpClientResponse types exported as interfaces instead of classes
What changed
HttpClient and HttpClientResponse types exported as interfaces instead of classes
From the upstream announcement:
#2781 Remove unused Retry-After header support #2779 Export HttpClient types as interfaces instead of classes Stripe.HttpClient and Stripe.HttpClientResponse types now reflect the minimal interface contract rather than the concrete class, making custom HTTP client implementations easier to type correctly. #2778 Restore missing public type exports from v21 Stripe namespace Restores Stripe.StripeConfig , Stripe.CryptoProvider , Stripe.HttpClient , Stripe.HttpClientResponse , Stripe.Webhooks , Stripe.Signature , Stripe.WebhookTestHeaderOptions , Stripe.StripeResource , Stripe.LatestApiVersion , Stripe.HttpAgent , Stripe.HttpProtocol , and Stripe.RawErrorType type exports that were inadvertently dropped in the v22 type system migration. See the changelog for more details .
Who is affected
Purely a TypeScript type-surface mend with no runtime change.
To find out whether your repo is hit — file and line number, no code leaving your machine:
npx mendapi sync # the one network call: fetch the change feed npx mendapi scan --repo . # local scan, nothing leaves your machine
How to fix it
mendapi ships a deterministic migration pack for this change (stripe-node-v22-httpclient-interface). Preview the patch locally (dry-run is the default; nothing is modified without --apply):
npx mendapi fix --repo . --migration stripe-node-v22-httpclient-interface
The pack is idempotent, gold-regression tested, and safe on partially migrated code.
What the migration does:
Purely a TypeScript type-surface mend with no runtime change. Custom HTTP client classes that used "extends Stripe.HttpClient" (relying on the concrete class) must switch to "implements Stripe.HttpClient" and provide the interface members themselves, or extend the still-exported concrete default client. Same transform for HttpClientResponse subclasses. Value-position references to the removed class constructors (e.g. instanceof checks against Stripe.HttpClient) must be replaced with structural checks. This is a declaration-level edit driven by the class/interface distinction, so it needs syntax awareness of extends vs implements clauses — an AST-track candidate rather than a regex pack; classified code-fixable with the transform documented here.
Before:
class MyClient extends Stripe.HttpClient {
makeRequest(...args) { /* custom transport */ }
}
After:
class MyClient implements Stripe.HttpClient {
makeRequest(...args) { /* custom transport */ }
}
Detected and tracked by mendapi — Dependabot for every API you depend on. Scans run locally; your code never leaves your machine.
Related
- stripe breaking-change guide — every tracked stripe entry on one page, with fixability verdicts.
- Stripe Payment Records migration — the full migration guide with pack-backed fixes.
- What 47 Stripe API versions taught us about breaking-change detection — the long-form methodology report behind this provider's tracked changes.
- All monitored providers — live change counts for stripe and 19 others.
- Migration pack catalog — every deterministic fix mendapi ships.
- Getting started — scan your repo in 30 seconds, no code leaves your machine.