@unifeather/server
v0.1.0
Published
Framework-agnostic tracking endpoint (Web Request→Response) plus storage adapters for Cloudflare Analytics Engine and Drizzle-backed SQL databases.
Maintainers
Readme
@unifeather/server
Framework-agnostic tracking endpoint for
unifeather. createHandler returns a
plain Web (request) => Response, so the same code runs on Cloudflare
Workers/Pages and on Node (node:http, Express, …). Ships two storage adapters:
Cloudflare Analytics Engine and Drizzle-backed SQL (Postgres/SQLite/MySQL).
bun add @unifeather/server # or: npm i @unifeather/serverimport { createHandler } from "@unifeather/server";
import { sqlAdapter } from "@unifeather/server/sql";
import { drizzle } from "drizzle-orm/node-postgres";
import { Pool } from "pg";
const db = drizzle(new Pool({ connectionString: process.env.DATABASE_URL }));
const handler = createHandler({ adapter: sqlAdapter({ db }), cors: true });Subpath exports: @unifeather/server (handler), ./sql (Drizzle adapter),
./analytics-engine (Cloudflare adapter). drizzle-orm is an optional peer —
importing the Analytics Engine adapter never pulls it in.
See the main README for the Cloudflare setup, query-side sampling and the multi-dialect SQL adapter.
MIT © Dennis Hendricks
