Skip to content

feat(evlog): add better-auth integration#280

Merged
HugoRCD merged 8 commits intomainfrom
EVL-149
Apr 15, 2026
Merged

feat(evlog): add better-auth integration#280
HugoRCD merged 8 commits intomainfrom
EVL-149

Conversation

@HugoRCD
Copy link
Copy Markdown
Owner

@HugoRCD HugoRCD commented Apr 15, 2026

🔗 Linked issue

Resolves EVL-149

📚 Description

Add evlog/better-auth integration for automatic user identification on wide events from Better Auth sessions.

New exports (evlog/better-auth):

  • identifyUser() — manually identify a user from a session onto a wide event
  • createAuthMiddleware() — framework-agnostic middleware factory with include/exclude, onIdentify/onAnonymous hooks
  • createAuthIdentifier() — Nitro request hook wrapper
  • maskEmail() — email masking utility
  • BetterAuthInstance type — minimal type for the auth instance

Key features:

  • Safe by default — only extracts whitelisted user fields
  • auth.resolvedIn timing and auth.identified boolean on every wide event
  • auth.error flag on session resolution failures
  • extend option to pull plugin fields (organizations, roles)
  • userAgent capture from session data
  • Route filtering via include/exclude glob patterns

Also includes:

  • Full documentation page with multi-framework Quick Start (Nuxt, Next.js, Express, Hono, Fastify, Elysia, NestJS, Standalone)
  • Playground integration with real Better Auth setup
  • 35 unit tests
  • CI fix: override @noble/hashes to v1.x (pre-existing cuid2 compatibility issue)

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@HugoRCD HugoRCD self-assigned this Apr 15, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evlog-docs Ready Ready Preview, Comment, Open in v0 Apr 15, 2026 6:37pm
just-use-evlog Ready Ready Preview, Comment Apr 15, 2026 6:37pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 15, 2026

Thank you for following the naming conventions! 🙏

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 15, 2026

Benchmark report

Bundle size

Threshold: 5% · 🔴 larger · 🟡 warning · 🟢 smaller · ⚪ unchanged · 🆕 new

Status Entry Base (gzip) Current (gzip) Change Raw delta
framework/nitro 6.82 kB 6.82 kB 0.0% 0 B
framework/next 4.13 kB 4.13 kB 0.0% 0 B
framework/ai 4.04 kB 4.04 kB 0.0% 0 B
adapter/datadog 2.44 kB 2.44 kB 0.0% 0 B
framework/vite 2.40 kB 2.40 kB 0.0% 0 B
adapter/sentry 2.34 kB 2.34 kB 0.0% 0 B
adapter/otlp 2.10 kB 2.10 kB 0.0% 0 B
enrichers 1.92 kB 1.92 kB 0.0% 0 B
framework/sveltekit 1.54 kB 1.54 kB 0.0% 0 B
utils 1.52 kB 1.52 kB 0.0% 0 B
adapter/posthog 1.50 kB 1.50 kB 0.0% 0 B
error 1.46 kB 1.46 kB 0.0% 0 B
adapter/fs 1.41 kB 1.41 kB 0.0% 0 B
pipeline 1.35 kB 1.35 kB 0.0% 0 B
adapter/axiom 1.32 kB 1.32 kB 0.0% 0 B
http 1.23 kB 1.23 kB 0.0% 0 B
framework/nestjs 1.21 kB 1.21 kB 0.0% 0 B
adapter/hyperdx 1.19 kB 1.19 kB 0.0% 0 B
adapter/better-stack 1.09 kB 1.09 kB 0.0% 0 B
framework/elysia 1.05 kB 1.05 kB 0.0% 0 B
framework/fastify 1010 B 1010 B 0.0% 0 B
workers 977 B 977 B 0.0% 0 B
framework/express 702 B 702 B 0.0% 0 B
framework/hono 595 B 595 B 0.0% 0 B
browser 289 B 289 B 0.0% 0 B
core (index) 254 B 254 B 0.0% 0 B
toolkit 242 B 242 B 0.0% 0 B
logger 207 B 207 B 0.0% 0 B
client 128 B 128 B 0.0% 0 B
types 31 B 31 B 0.0% 0 B
Total 46.41 kB 46.41 kB 0.0% 0 B

@HugoRCD HugoRCD changed the title feat: add better-auth adapter feat(evlog): add better-auth integration Apr 15, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 15, 2026

npm i https://pkg.pr.new/evlog@280
npm i https://pkg.pr.new/@evlog/nuxthub@280

commit: 9221ddd

@HugoRCD HugoRCD merged commit af76f97 into main Apr 15, 2026
14 of 15 checks passed
@HugoRCD HugoRCD deleted the EVL-149 branch April 15, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant