Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages/better-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
### v1.0.0-beta.4 (2026-03-18)
* * *

### Feature:
- Added `getCustomerCreateParams` option to `ChargebeeOptions`, allowing you to return additional Chargebee customer creation params (e.g. `first_name`, `last_name`, phone) for user customers. The callback receives the `user` object and an optional request `ctx` (available when the customer is created on-demand, not during sign-up).
- Registered the missing `GET /subscription/success` endpoint. Chargebee's `redirect_url` after hosted-page checkout points to this endpoint, which forwards the user to their original `successUrl`. Without this endpoint the post-checkout redirect resulted in a 404.
- When `organization.enabled: true`, the `chargebeeCustomerId` field is no longer added to the `user` table 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.
- Added `createSubscription` route to initiate a new Chargebee hosted checkout session.
- Added `updateSubscription` route to update an existing subscription via hosted page.
- Added `listActiveSubscriptions` route (`GET /subscription/list`) to retrieve the caller's active/trialing subscriptions enriched with plan `limits` and `itemPriceId`.
- Added a `user.delete` database hook that automatically cancels active Chargebee subscriptions and cleans up local subscription records when a user is deleted.
- Introduced `version.ts` to track and expose the package version, used to set the `__clientIdentifier` on the Chargebee client.
- Added `getOrCreateCustomerId` shared helper to deduplicate customer creation logic across routes, with race-condition protection via a fresh-read guard.

### Bug:
- Webhook handler no longer returns early when no matching plan is found for an `itemPriceId`; the subscription is still tracked and a warning is logged instead.

### Improvement:
- Added a startup warning when `webhookUsername` / `webhookPassword` are not configured, alerting that the webhook endpoint is unauthenticated.
- Extracted `isActiveOrTrialing` helper and used it consistently across hooks and routes.
- Renamed `onEvent` to `webhookHandler`, which now receives the typed `WebhookHandler` instance — use `handler.on(WebhookEventType.X, fn)` for per-event listeners with full type safety.

### Breaking Change:
- `cb.customer.create` no longer automatically splits `user.name` into `first_name` and `last_name`. Better Auth uses a single `user.name` field; pass name fields explicitly via `getCustomerCreateParams` if needed.
- The user update hook no longer syncs `first_name` / `last_name` to Chargebee — only `email` is synced.


### v1.0.0-beta.2 (2026-02-05)
* * *

Expand Down
Loading
Loading