[PR #3760] [CLOSED] feat(stripe): Support dynamic trial days via trialDays param #13239

Closed
opened 2026-04-13 08:50:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3760
Author: @Alfredao
Created: 8/2/2025
Status: Closed

Base: canaryHead: patch-1


📝 Commits (1)

  • 17a78e1 feat(stripe): Support dynamic trial days via trialDays param

📊 Changes

1 file changed (+11 additions, -1 deletions)

View changed files

📝 packages/stripe/src/index.ts (+11 -1)

📄 Description

Allow overriding default plan trial period by passing trialDays in the upgradeSubscription payload. Falls back to plan.freeTrial if not provided.

This update allows dynamic control over the trial period when creating a Stripe subscription. Instead of relying solely on the fixed trial duration defined in the plan (e.g. 5 days), the app can now provide a custom trialDays value based on internal logic.

The trial period is managed by custom business logic within my app. For example, if a user upgrades to a paid plan while still having 8 days remaining on their in-app free trial, we can pass trialDays: 8 to Stripe to ensure they retain those remaining trial days before billing begins. This prevents cutting the trial short and provides a smoother upgrade experience.

This makes the subscription experience smoother and fairer, especially when users upgrade early.


Summary by cubic

Added support for passing a custom trialDays value when upgrading a Stripe subscription, allowing dynamic control over the trial period. If trialDays is not provided, the default plan trial duration is used.


🔄 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/3760 **Author:** [@Alfredao](https://github.com/Alfredao) **Created:** 8/2/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`17a78e1`](https://github.com/better-auth/better-auth/commit/17a78e173af1f3a589d09b7b70c794c0e7a40883) feat(stripe): Support dynamic trial days via trialDays param ### 📊 Changes **1 file changed** (+11 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/stripe/src/index.ts` (+11 -1) </details> ### 📄 Description Allow overriding default plan trial period by passing `trialDays` in the upgradeSubscription payload. Falls back to plan.freeTrial if not provided. This update allows dynamic control over the trial period when creating a Stripe subscription. Instead of relying solely on the fixed trial duration defined in the plan (e.g. 5 days), the app can now provide a custom `trialDays` value based on internal logic. The trial period is managed by custom business logic within my app. For example, if a user upgrades to a paid plan while still having 8 days remaining on their in-app free trial, we can pass `trialDays: 8` to Stripe to ensure they retain those remaining trial days before billing begins. This prevents cutting the trial short and provides a smoother upgrade experience. This makes the subscription experience smoother and fairer, especially when users upgrade early. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added support for passing a custom trialDays value when upgrading a Stripe subscription, allowing dynamic control over the trial period. If trialDays is not provided, the default plan trial duration is used. <!-- 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-04-13 08:50:15 -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#13239