You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add architecture diagram and fix file tree in README
Replace the outdated file tree (which referenced nonexistent files like
handlers.js, tracker.js, adapter.js, d1.js) with a Mermaid flowchart
showing the data flow from clients through auth to platform entry points,
plus an accurate file tree showing this repo vs @agent-analytics/core.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
`@agent-analytics/core` does the heavy lifting — it exports `createAnalyticsHandler({ db, validateWrite, validateRead })`, a platform-agnostic request handler. This repo plugs in the auth layer and platform glue: Cloudflare Workers with D1, or Node.js with SQLite. Add a new platform by providing a database adapter and calling the handler factory.
375
+
376
+
```
377
+
src/ (this repo — platform glue + auth)
378
+
auth.js — Token + API key validation (constant-time compare)
tracker.js — Client-side tracking script (served at GET /tracker.js)
392
+
ulid.js — ULID generation for event IDs
356
393
```
357
394
358
-
Handlers are platform-agnostic — they return data and let the platform decide how to write it. On Cloudflare, writes go through a Queue (if configured) or `ctx.waitUntil`. On Node.js, writes are inline. Add a new adapter to support any database or platform.
0 commit comments