[Stripe] getCheckoutSessionParams is missing if user is subscribing annually or monthly #1191

Closed
opened 2026-03-13 08:27:19 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @JE4GLE on GitHub (May 10, 2025).

I want to

  1. Send an analytics request server-side when user is trying to subscribe to a product
  2. Change session parameters based on annual or monthly subscription

Currently, I can't do that.

The solution I'd like

Add an annual: boolean parameter to getCheckoutSessionParams.

The alternatives I've considered

I don't see any alternatives.

Originally created by @JE4GLE on GitHub (May 10, 2025). I want to 1. Send an analytics request server-side when user is trying to subscribe to a product 2. Change session parameters based on annual or monthly subscription Currently, I can't do that. ### The solution I'd like Add an `annual: boolean` parameter to `getCheckoutSessionParams`. ### The alternatives I've considered I don't see any alternatives.
Author
Owner

@dosubot[bot] commented on GitHub (Aug 9, 2025):

Hi, @JE4GLE. 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 annual: boolean parameter to the getCheckoutSessionParams function.
  • The goal is to enable server-side analytics and session customization based on subscription type.
  • Currently, the function does not support differentiating between annual and monthly subscriptions.
  • There has been no further activity or discussion on this issue.

Next Steps:

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

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 9, 2025): Hi, @JE4GLE. 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 `annual: boolean` parameter to the `getCheckoutSessionParams` function. - The goal is to enable server-side analytics and session customization based on subscription type. - Currently, the function does not support differentiating between annual and monthly subscriptions. - There has been no further activity or discussion on this issue. **Next Steps:** - Please let me know if this feature is still relevant to the latest version of better-auth by commenting on this issue. - If I do not hear back within 7 days, the issue will be automatically closed. Thank you for your understanding and contribution!
Author
Owner

@JE4GLE commented on GitHub (Aug 9, 2025):

@dosubot It is still relevant. I was not able to find any workaround and this is blocking realizing my solution.

@JE4GLE commented on GitHub (Aug 9, 2025): @dosubot It is still relevant. I was not able to find any workaround and this is blocking realizing my solution.
Author
Owner

@JE4GLE commented on GitHub (Nov 2, 2025):

@dosubot @better-auth-agent
I would label it as a bug now, as there currently is no workaround and blocks the use case completly

@JE4GLE commented on GitHub (Nov 2, 2025): @dosubot @better-auth-agent I would label it as a bug now, as there currently is no workaround and blocks the use case completly
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 2, 2025):

Based on the issue description, the current behavior blocks your use case because you can’t send the required analytics request nor tailor session parameters when switching between annual and monthly subscriptions. The recommended next steps are:

  1. Confirm in your tracking or error logs that no alternative hook or workaround exists for handling this scenario.
  2. Reclassify the issue as a bug, as there’s no workaround available for sending the analytics request and modifying session parameters based on the billing interval.
  3. File or update the bug report with details that the lack of an annual: boolean parameter in getCheckoutSessionParams prevents proper analytics and customization, which has a significant impact on the subscription flow.
  4. Monitor responses or assign the issue to a developer for faster resolution.

This approach should help ensure that the bug is prioritized for a fix that properly passes the billing interval indicator through the session parameters [1].

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Nov 2, 2025): Based on the issue description, the current behavior blocks your use case because you can’t send the required analytics request nor tailor session parameters when switching between annual and monthly subscriptions. The recommended next steps are: 1. Confirm in your tracking or error logs that no alternative hook or workaround exists for handling this scenario. 2. Reclassify the issue as a bug, as there’s no workaround available for sending the analytics request and modifying session parameters based on the billing interval. 3. File or update the bug report with details that the lack of an annual: boolean parameter in getCheckoutSessionParams prevents proper analytics and customization, which has a significant impact on the subscription flow. 4. Monitor responses or assign the issue to a developer for faster resolution. This approach should help ensure that the bug is prioritized for a fix that properly passes the billing interval indicator through the session parameters [[1]](https://github.com/better-auth/better-auth/issues/2609). <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@dosubot[bot] commented on GitHub (Nov 2, 2025):

You're right—this is a confirmed architectural gap. The annual parameter is accepted and used internally to select the correct price, but it is not passed to getCheckoutSessionParams, so you can't customize session parameters or send analytics based on annual/monthly selection. There is no workaround, and this blocks use cases that depend on knowing the subscription period at session creation. The fix would be to add the annual flag to the data passed to getCheckoutSessionParams, which is backward compatible and would unblock these flows. This is a valid bug and should be prioritized for a fix. Reference

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 2, 2025): <!-- Answer --> You're right—this is a confirmed architectural gap. The annual parameter is accepted and used internally to select the correct price, but it is not passed to getCheckoutSessionParams, so you can't customize session parameters or send analytics based on annual/monthly selection. There is no workaround, and this blocks use cases that depend on knowing the subscription period at session creation. The fix would be to add the annual flag to the data passed to getCheckoutSessionParams, which is backward compatible and would unblock these flows. This is a valid bug and should be prioritized for a fix. [Reference](https://github.com/better-auth/better-auth/blob/1881c33126ddd6385cc355dc6933133c3ce1d97f/packages/stripe/src/index.ts#L128-L615) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/a0de4f62-16f8-4a34-a5f4-41914acd0fa7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a0de4f62-16f8-4a34-a5f4-41914acd0fa7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a0de4f62-16f8-4a34-a5f4-41914acd0fa7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a0de4f62-16f8-4a34-a5f4-41914acd0fa7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a0de4f62-16f8-4a34-a5f4-41914acd0fa7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a0de4f62-16f8-4a34-a5f4-41914acd0fa7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a0de4f62-16f8-4a34-a5f4-41914acd0fa7?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/2609)
Author
Owner

@bytaesu commented on GitHub (Nov 20, 2025):

Hello @JE4GLE,

You can currently access the value using ctx.body.annual. However, since ctx.body is not typed (it's any), this will need improvement.

Thanks for bringing up the issue!

@bytaesu commented on GitHub (Nov 20, 2025): Hello @JE4GLE, You can currently access the value using `ctx.body.annual`. However, since `ctx.body` is not typed (it's `any`), this will need improvement. Thanks for bringing up the issue!
Author
Owner

@dosubot[bot] commented on GitHub (Feb 19, 2026):

Hi, @JE4GLE. 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 an annual: boolean parameter for getCheckoutSessionParams to enable server-side analytics and customize session parameters by subscription type.
  • This feature is currently unsupported, creating an architectural gap as the annual flag is used internally but not exposed.
  • You confirmed the issue is still relevant and blocks your use case, leading to its reclassification as a bug.
  • A temporary workaround exists by accessing ctx.body.annual, but it lacks proper typing and is not ideal.

Next Steps:

  • Please confirm if this issue remains relevant with the latest version of better-auth by commenting here to keep the discussion open.
  • If no response is received within 7 days, I will automatically close the issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Feb 19, 2026): Hi, @JE4GLE. 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 an `annual: boolean` parameter for `getCheckoutSessionParams` to enable server-side analytics and customize session parameters by subscription type. - This feature is currently unsupported, creating an architectural gap as the annual flag is used internally but not exposed. - You confirmed the issue is still relevant and blocks your use case, leading to its reclassification as a bug. - A temporary workaround exists by accessing `ctx.body.annual`, but it lacks proper typing and is not ideal. **Next Steps:** - Please confirm if this issue remains relevant with the latest version of better-auth by commenting here to keep the discussion open. - If no response is received within 7 days, I will automatically close the issue. 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#1191