Releasing v1.0.0-beta.4#25
Merged
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
0b49d34 to
a8e8bd3
Compare
a8e8bd3 to
2bf056a
Compare
cb-sriramthiagarajan
approved these changes
Mar 17, 2026
Better Auth uses a single user.name field, so automatically splitting it into first_name/last_name when creating or updating a Chargebee customer was the wrong default. This removes that behaviour and introduces getCustomerCreateParams — a typed callback on ChargebeeOptions that lets callers explicitly pass first_name, last_name, or any other Customer.CreateInputParam fields when creating user customers. The callback is supported in both createCustomerOnSignUp (sign-up hook) and on-demand customer creation (subscription routes). For organisations, the existing organization.getCustomerCreateParams already handles this. The user update hook now only syncs email to Chargebee. Made-with: Cursor
Chargebee's redirect_url after hosted-page checkout was pointing to /subscription/success, but the endpoint was never registered, causing a 404 for every user after a successful checkout. Added the subscriptionSuccess endpoint that receives Chargebee's post-checkout redirect and forwards the user to their original successUrl via the callbackURL query param. Updated docs and changelog to clearly explain the intermediate redirect flow. Made-with: Cursor
- userSchema is now omitted when organization.enabled is true — no chargebeeCustomerId column is added to the user table in org-only billing mode, preventing adapter crashes on missing columns - subscriptionSchema and subscriptionItemSchema are now omitted when subscription.enabled is not set — only tables that are actually in use get created - user.create and user.update hooks now return early when organization.enabled is true, preventing any attempt to write chargebeeCustomerId to the user table in org mode - handleCustomerDeletion fallback user-table query is now guarded by !organization.enabled, preventing a guaranteed crash on every customer_deleted webhook event in org-only mode Made-with: Cursor
430bdf5 to
ebbf2dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v1.0.0-beta.4 (2026-03-18)
Feature:
getCustomerCreateParamsoption toChargebeeOptions, allowing you to return additional Chargebee customer creation params (e.g.first_name,last_name, phone) for user customers. The callback receives theuserobject and an optional requestctx(available when the customer is created on-demand, not during sign-up).GET /subscription/successendpoint. Chargebee'sredirect_urlafter hosted-page checkout points to this endpoint, which forwards the user to their originalsuccessUrl. Without this endpoint the post-checkout redirect resulted in a 404.organization.enabled: true, thechargebeeCustomerIdfield is no longer added to theusertable and user-level billing hooks are disabled. Previously the user schema was always included regardless of billing mode, causing adapter crashes if the column was missing from the database.createSubscriptionroute to initiate a new Chargebee hosted checkout session.updateSubscriptionroute to update an existing subscription via hosted page.listActiveSubscriptionsroute (GET /subscription/list) to retrieve the caller's active/trialing subscriptions enriched with planlimitsanditemPriceId.user.deletedatabase hook that automatically cancels active Chargebee subscriptions and cleans up local subscription records when a user is deleted.version.tsto track and expose the package version, used to set the__clientIdentifieron the Chargebee client.getOrCreateCustomerIdshared helper to deduplicate customer creation logic across routes, with race-condition protection via a fresh-read guard.Bug:
itemPriceId; the subscription is still tracked and a warning is logged instead.Improvement:
webhookUsername/webhookPasswordare not configured, alerting that the webhook endpoint is unauthenticated.isActiveOrTrialinghelper and used it consistently across hooks and routes.onEventtowebhookHandler, which now receives the typedWebhookHandlerinstance — usehandler.on(WebhookEventType.X, fn)for per-event listeners with full type safety.Breaking Change:
cb.customer.createno longer automatically splitsuser.nameintofirst_nameandlast_name. Better Auth uses a singleuser.namefield; pass name fields explicitly viagetCustomerCreateParamsif needed.first_name/last_nameto Chargebee — onlyemailis synced.