[PR #5509] [MERGED] feat(stripe): add StripePlugin type #6049

Closed
opened 2026-03-13 12:45:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5509
Author: @himself65
Created: 10/22/2025
Status: Merged
Merged: 10/22/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/10/22/stripe-type


📝 Commits (1)

  • 7c6e42c feat(stripe): add StripePlugin type

📊 Changes

4 files changed (+184 additions, -126 deletions)

View changed files

📝 packages/stripe/src/index.ts (+13 -7)
📝 packages/stripe/src/stripe.test.ts (+43 -3)
📝 packages/stripe/src/types.ts (+117 -110)
📝 packages/stripe/src/utils.ts (+11 -6)

📄 Description

Summary by cubic

Adds a new StripePlugin type and switches subscription config to a discriminated union to make API endpoints type-safe based on the enabled flag.

  • Refactors

    • Added SubscriptionOptions and updated StripeOptions.subscription to be either {enabled: false} or {enabled: true} & SubscriptionOptions.
    • API endpoints for subscriptions are now exposed only when subscription.enabled is true (type-checked).
    • Changed getPlans to accept options.subscription and throw when subscriptions are disabled.
    • Updated internal usage to use subscriptionOptions and getPlans(options.subscription).
  • Migration

    • Replace getPlans(options) with getPlans(options.subscription) in any custom code.
    • Ensure your StripeOptions.subscription matches the new shape: {enabled: false} or {enabled: true, plans: [...], ...}.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5509 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/22/2025 **Status:** ✅ Merged **Merged:** 10/22/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/22/stripe-type` --- ### 📝 Commits (1) - [`7c6e42c`](https://github.com/better-auth/better-auth/commit/7c6e42cf5480b1868fc1030b32e450b6fe3a20f3) feat(stripe): add `StripePlugin` type ### 📊 Changes **4 files changed** (+184 additions, -126 deletions) <details> <summary>View changed files</summary> 📝 `packages/stripe/src/index.ts` (+13 -7) 📝 `packages/stripe/src/stripe.test.ts` (+43 -3) 📝 `packages/stripe/src/types.ts` (+117 -110) 📝 `packages/stripe/src/utils.ts` (+11 -6) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Adds a new StripePlugin type and switches subscription config to a discriminated union to make API endpoints type-safe based on the enabled flag. - **Refactors** - Added SubscriptionOptions and updated StripeOptions.subscription to be either {enabled: false} or {enabled: true} & SubscriptionOptions. - API endpoints for subscriptions are now exposed only when subscription.enabled is true (type-checked). - Changed getPlans to accept options.subscription and throw when subscriptions are disabled. - Updated internal usage to use subscriptionOptions and getPlans(options.subscription). - **Migration** - Replace getPlans(options) with getPlans(options.subscription) in any custom code. - Ensure your StripeOptions.subscription matches the new shape: {enabled: false} or {enabled: true, plans: [...], ...}. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:45:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#6049