Skip to content

Commit af76f97

Browse files
committed
Merge branch 'EVL-149'
2 parents 036fc45 + 9221ddd commit af76f97

18 files changed

Lines changed: 1566 additions & 25 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'evlog': minor
3+
---
4+
5+
Add `evlog/better-auth` integration for automatic user identification from [Better Auth](https://better-auth.com/) sessions.
6+
7+
**New exports** (`evlog/better-auth`):
8+
- `identifyUser(log, session, options?)` — sets `userId`, `user`, and `session` fields on a wide event. Returns `true` if identified
9+
- `createAuthMiddleware(auth, options?)` — framework-agnostic `(log, headers, path?) => Promise<boolean>` with route filtering, timing capture, and lifecycle hooks
10+
- `createAuthIdentifier(auth, options?)` — Nitro `request` hook factory for standalone Nitro apps
11+
- `maskEmail(email)` — utility to mask emails for safe logging (`h***@example.com`)
12+
- `BetterAuthInstance` — reusable type for the auth parameter
13+
14+
**Features:**
15+
- `include`/`exclude` route pattern filtering on `createAuthMiddleware`
16+
- `extend` callback for Better Auth plugin fields (organizations, roles, etc.)
17+
- `auth.resolvedIn` timing in every wide event
18+
- `auth.identified` boolean in every wide event
19+
- `session.userAgent` captured by default
20+
- `onIdentify`/`onAnonymous` lifecycle hooks
21+
- `console.warn` in development when session resolution fails

apps/docs/app/app.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@ export default defineAppConfig({
4646
primary: 'blue',
4747
neutral: 'zinc',
4848
},
49+
prose: {
50+
codeIcon: {
51+
'nuxt': 'i-vscode-icons-file-type-nuxt',
52+
'nuxt / nitro': 'i-vscode-icons-file-type-nuxt',
53+
'next.js': 'i-simple-icons-nextdotjs',
54+
'express': 'i-simple-icons-express',
55+
'hono': 'i-simple-icons-hono',
56+
'fastify': 'i-simple-icons-fastify',
57+
'elysia': 'i-custom:elysia',
58+
'nestjs': 'i-simple-icons-nestjs',
59+
'standalone': 'i-lucide-box',
60+
'nitro': 'i-custom:nitro',
61+
},
62+
},
4963
button: {
5064
slots: {
5165
base: 'active:translate-y-px transition-transform duration-300',

0 commit comments

Comments
 (0)