[GH-ISSUE #3519] Store interval on the subscription #9631

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

Originally created by @cjroebuck on GitHub (Jul 21, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3519

Is this suited for github?

  • Yes, this is suited for github

There doesn't seem to be any easy way to determine whether the active subscription is on a monthly or yearly billing interval. This makes it difficult to get info about the plan. Only plan name is stored on the subscription currently, but this alone doesn't tell you if this is a monthly or annual plan.

This update may also help fix other issues around not being able to switch from a plan based on billing cycle alone. see e.g. #3393, #3236, #3235

Describe the solution you'd like

Store interval or plan lookup key on the subscription schema.

Describe alternatives you've considered

Instead of using the lookupKey and annualLookupKey on the plans object for one plan, create a plan config for each of monthly and annual.

..e.g:

instead of:

plans : [{
   name: 'pro',
   lookupKey: 'pro-monthly',
   annualLookupKey: 'pro-annual'
}],

do:

plans: [{
   name: 'pro-monthly',
   lookupKey: 'pro-monthly',
   ...
}, {
   name: 'pro-annual',
   lookupKey: 'pro-annual'
   ...
}]

Additional context

No response

Originally created by @cjroebuck on GitHub (Jul 21, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3519 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. There doesn't seem to be any easy way to determine whether the active subscription is on a monthly or yearly billing interval. This makes it difficult to get info about the plan. Only plan name is stored on the subscription currently, but this alone doesn't tell you if this is a monthly or annual plan. This update may also help fix other issues around not being able to switch from a plan based on billing cycle alone. see e.g. #3393, #3236, #3235 ### Describe the solution you'd like Store `interval` or plan lookup key on the subscription schema. ### Describe alternatives you've considered Instead of using the lookupKey and annualLookupKey on the plans object for one plan, create a plan config for each of monthly and annual. ..e.g: instead of: ``` plans : [{ name: 'pro', lookupKey: 'pro-monthly', annualLookupKey: 'pro-annual' }], ``` do: ``` plans: [{ name: 'pro-monthly', lookupKey: 'pro-monthly', ... }, { name: 'pro-annual', lookupKey: 'pro-annual' ... }] ``` ### Additional context _No response_
GiteaMirror added the enhancementlocked labels 2026-04-13 05:12:44 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 20, 2025):

Hi, @cjroebuck. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested adding an interval field (e.g., monthly or yearly) to the subscription schema to better identify billing cycles.
  • Currently, only the plan name is stored, which complicates managing billing intervals and switching plans.
  • You also suggested an alternative approach of creating separate plan configurations for monthly and annual plans instead of using lookup keys within a single plan.
  • There has been no further activity or comments on this issue since your initial request.

Next Steps:

  • Please let me know if this issue is still relevant to the latest version of better-auth by commenting here.
  • If I do not hear back within 7 days, this issue will be automatically closed.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3422747048 --> @dosubot[bot] commented on GitHub (Oct 20, 2025): Hi, @cjroebuck. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested adding an interval field (e.g., monthly or yearly) to the subscription schema to better identify billing cycles. - Currently, only the plan name is stored, which complicates managing billing intervals and switching plans. - You also suggested an alternative approach of creating separate plan configurations for monthly and annual plans instead of using lookup keys within a single plan. - There has been no further activity or comments on this issue since your initial request. **Next Steps:** - Please let me know if this issue is still relevant to the latest version of better-auth by commenting here. - If I do not hear back within 7 days, this issue will be automatically closed. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9631