Skip to content

Export manually maintained types for OAuthToken and OAuth param classes#2711

Merged
prathmesh-stripe merged 2 commits into
masterfrom
prathmesh/oauth-export
May 12, 2026
Merged

Export manually maintained types for OAuthToken and OAuth param classes#2711
prathmesh-stripe merged 2 commits into
masterfrom
prathmesh/oauth-export

Conversation

@prathmesh-stripe
Copy link
Copy Markdown
Contributor

@prathmesh-stripe prathmesh-stripe commented May 12, 2026

Why

The OAuth-related types (OAuthToken, OAuthTokenParams, OAuthAuthorizeUrlParams, OAuthAuthorizeUrlOptions, OAuthDeauthorization, OAuthDeauthorizeParams) were defined as module-private interfaces in OAuth.ts and not re-exported from the Stripe namespace. This meant users who wanted to type-annotate variables or function parameters with these types had no way to reference them — they had to inline the shapes or use any.

What

  • Export all OAuth interfaces and the OAuthAuthorizeUrlParams namespace from src/resources/OAuth.ts
  • Re-export them from the Stripe namespace in stripe.core.ts and stripe.esm.node.ts
  • Add type-compilation tests in testProjects/types/typescriptTest.ts to verify the exports are usable

See Also

Changelog

// ❌ Before (v22.0.0-v22.1.1)
const oAuthToken: Stripe.OAuthToken = {};

// ✅ After (works on v22.1.2+)
const oAuthToken: Stripe.OAuthToken = {};

@prathmesh-stripe prathmesh-stripe changed the title Added Oauth export Export OAuth related types May 12, 2026
@prathmesh-stripe prathmesh-stripe changed the title Export OAuth related types Export manually maintained types for OAuthToken and OAuth param classes May 12, 2026
@prathmesh-stripe prathmesh-stripe marked this pull request as ready for review May 12, 2026 13:51
@prathmesh-stripe prathmesh-stripe requested a review from a team as a code owner May 12, 2026 13:51
@prathmesh-stripe prathmesh-stripe requested review from xavdid and removed request for a team May 12, 2026 13:51
Copy link
Copy Markdown
Member

@xavdid xavdid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! great tests & example

@prathmesh-stripe prathmesh-stripe enabled auto-merge (squash) May 12, 2026 18:48
@prathmesh-stripe prathmesh-stripe merged commit 185f336 into master May 12, 2026
11 checks passed
@prathmesh-stripe prathmesh-stripe deleted the prathmesh/oauth-export branch May 12, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants