From 97a1550252675ef231a7db65be2f54229f6dfa51 Mon Sep 17 00:00:00 2001 From: cb-alish Date: Fri, 10 Jul 2026 17:12:03 +0530 Subject: [PATCH] better-auth: add v1.2.0 changelog Document the webhook event bus feature for async processing, the shared dispatch/validator refactor, and the publish-handler error handling fix. Co-authored-by: Cursor --- packages/better-auth/CHANGELOG.md | 17 +++++++++++++++++ packages/better-auth/src/version.ts | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/better-auth/CHANGELOG.md b/packages/better-auth/CHANGELOG.md index a826a41..2a07f65 100644 --- a/packages/better-auth/CHANGELOG.md +++ b/packages/better-auth/CHANGELOG.md @@ -1,3 +1,20 @@ +### v1.2.0 (2026-07-10) +* * * + +### Feature: +- Added an optional `webhookEventBus` option to `ChargebeeOptions` for asynchronous webhook processing. When configured, the webhook endpoint validates and parses each incoming Chargebee event and forwards it to `webhookEventBus.publish(event)` (typically an application queue) instead of running the DB-sync hooks inline. When omitted, events continue to be processed synchronously within the request. +- Added `createChargebeeWebhookProcessor` to consume queued events and run the plugin's DB-sync hooks. It accepts either an in-process Better Auth instance (`{ auth }`) or an explicit `{ context: { adapter, logger } }` for consumers running in a separate process. +- Exported new types: `ChargebeeWebhookEventBus`, `WebhookEvent`, `ChargebeeWebhookProcessor`, and `ChargebeeWebhookProcessorSource`. + +### Improvement: +- Extracted a shared `dispatchWebhookEvent` mapping so the synchronous handler and the async queue consumer route events to the same subscription/customer hooks, and factored out `buildRequestValidator` for the Basic Auth setup. +- `WebhookEvent` now maps to Chargebee's dedicated `WebhookEvent` type (previously aliased to `Event`). + +### Bug: +- The webhook publish handler now catches event-bus failures and responds with `500` so Chargebee retries the delivery, instead of returning `200 OK` and silently dropping events that were never queued. + +--- + ### v1.1.0 (2026-04-22) * * * diff --git a/packages/better-auth/src/version.ts b/packages/better-auth/src/version.ts index f5da581..a3a25fb 100644 --- a/packages/better-auth/src/version.ts +++ b/packages/better-auth/src/version.ts @@ -1 +1 @@ -export const VERSION = "1.1.0"; +export const VERSION = "1.2.0";