Use Cases
Recipes that solve a specific problem with evlog — capture browser logs, observe AI SDK calls, identify users from Better Auth, build a tamper-evident audit trail, enrich every event with derived context.

Use Cases are recipes, not features. Each one solves a specific problem with the same evlog primitives you already know — wide events, structured errors, drains, enrichers. They live as their own section because they have enough surface area (multiple pages each, dedicated examples) to deserve direct navigation, but they're not a separate runtime — same logger, same drain pipeline, same types.

You want to…See
Send browser logs to your server with batching, retries, and sendBeacon fallbackClient Logging
Capture every AI SDK call with token usage, tool calls, streaming metrics, and costAI SDK
Identify the authenticated user (and their org / role) on every wide eventBetter Auth
Build a tamper-evident audit trail with hash chains, denials, redaction-aware diffsAudit Logs
Add derived context (User-Agent, geo, request size, trace context) to every eventEnrichers

How they relate

your app code
     │
     ▼
┌──────────────────────────────────────────────────────────────────┐
│   evlog logger                                                   │
│                                                                  │
│   ┌─────────────────┐   ┌─────────────────┐   ┌──────────────┐   │
│   │ Client logs     │   │ AI SDK wrapper  │   │ Audit logger │   │
│   │ (browser → API) │   │ (token / tools) │   │ (hash chain) │   │
│   └─────────────────┘   └─────────────────┘   └──────────────┘   │
│            │                     │                    │          │
│            └─────────────────────┼────────────────────┘          │
│                                  ▼                               │
│                       enrich  →  drain                           │
│                       (User-Agent, geo, trace, …)                │
└──────────────────────────────────────────────────────────────────┘

Every use case is opt-in. Adopt one, two, or all five — they coexist in the same logger, the same drain pipeline, and the same enrich chain.

Where to go next

  • Building a new use case from scratch? Start with Wide Events for the conceptual model.
  • Need to send the resulting events somewhere? Pick an adapter.
  • Want to write your own use case as a reusable enricher / plugin? See Custom Enrichers or Plugins.