[GH-ISSUE #2358] Export the StripePlan or StripeOptions type, so we can have type safety when creating an array of sprite plans outside of auth.ts #9163

Closed
opened 2026-04-13 04:31:44 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @DevDuki on GitHub (Apr 19, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2358

Originally assigned to: @ping-maxwell on GitHub.

Is this suited for github?

  • Yes, this is suited for github

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

Export the type StripePlan (or at least the StripeOptions, and then we can index any option we want like, StripeOptions['subscription']['plans']) so we can have a separate file like stripe.ts that exports an array of plans, like so:

export const subscriptionPlans: StripePlan[] = [
	// ... my plans
]

Would love to be able to do that, to reduce clutter in the auth.ts file.

Describe alternatives you've considered

I tried getting the type like this, but it's not working and also would look very ugly Parameters<typeof stripe>[0]['subscription']['plans']

Additional context

No response

Originally created by @DevDuki on GitHub (Apr 19, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2358 Originally assigned to: @ping-maxwell on GitHub. ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. _No response_ ### Describe the solution you'd like Export the type `StripePlan` (or at least the `StripeOptions`, and then we can index any option we want like, `StripeOptions['subscription']['plans']`) so we can have a separate file like `stripe.ts` that exports an array of plans, like so: ```typescripts export const subscriptionPlans: StripePlan[] = [ // ... my plans ] ``` Would love to be able to do that, to reduce clutter in the `auth.ts` file. ### Describe alternatives you've considered I tried getting the type like this, but it's not working and also would look very ugly `Parameters<typeof stripe>[0]['subscription']['plans']` ### Additional context _No response_
GiteaMirror added the enhancementlocked labels 2026-04-13 04:31:44 -05:00
Author
Owner

@ping-maxwell commented on GitHub (Apr 20, 2025):

🫡

<!-- gh-comment-id:2817036264 --> @ping-maxwell commented on GitHub (Apr 20, 2025): 🫡
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9163