Skip to content

Commit 79affbf

Browse files
Version Packages
1 parent 0d31647 commit 79affbf

3 files changed

Lines changed: 23 additions & 22 deletions

File tree

.changeset/better-auth-integration.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/evlog/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# evlog
22

3+
## 2.13.0
4+
5+
### Minor Changes
6+
7+
- [#280](https://github.com/HugoRCD/evlog/pull/280) [`fa0ee26`](https://github.com/HugoRCD/evlog/commit/fa0ee267a10d65164b4aec6caa64208ce08af291) Thanks [@HugoRCD](https://github.com/HugoRCD)! - Add `evlog/better-auth` integration for automatic user identification from [Better Auth](https://better-auth.com/) sessions.
8+
9+
**New exports** (`evlog/better-auth`):
10+
- `identifyUser(log, session, options?)` — sets `userId`, `user`, and `session` fields on a wide event. Returns `true` if identified
11+
- `createAuthMiddleware(auth, options?)` — framework-agnostic `(log, headers, path?) => Promise<boolean>` with route filtering, timing capture, and lifecycle hooks
12+
- `createAuthIdentifier(auth, options?)` — Nitro `request` hook factory for standalone Nitro apps
13+
- `maskEmail(email)` — utility to mask emails for safe logging (`h***@example.com`)
14+
- `BetterAuthInstance` — reusable type for the auth parameter
15+
16+
**Features:**
17+
- `include`/`exclude` route pattern filtering on `createAuthMiddleware`
18+
- `extend` callback for Better Auth plugin fields (organizations, roles, etc.)
19+
- `auth.resolvedIn` timing in every wide event
20+
- `auth.identified` boolean in every wide event
21+
- `session.userAgent` captured by default
22+
- `onIdentify`/`onAnonymous` lifecycle hooks
23+
- `console.warn` in development when session resolution fails
24+
325
## 2.12.0
426

527
### Minor Changes

packages/evlog/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "evlog",
3-
"version": "2.12.0",
3+
"version": "2.13.0",
44
"description": "Wide event logging library with structured error handling. Inspired by LoggingSucks.",
55
"author": "HugoRCD <contact@hrcd.fr>",
66
"homepage": "https://evlog.dev",

0 commit comments

Comments
 (0)