Blyp is a TypeScript logger for standalone apps and modern web frameworks. It gives you structured logging, framework adapters, client-to-server log ingestion, and optional connectors without turning the root README into a full manual.
createStructuredLog.bun add @blyp/core
npm install @blyp/core | pnpm add @blyp/core | yarn add @blyp/core
If you use the Expo logger, also install expo-network.
npx expo install expo-network
import { logger } from '@blyp/core';
logger.info('Server started', { port: 3000 });
logger.success('Connected to database');
logger.error('Payment failed', { orderId: 'ord_123' });
import { createStructuredLog } from '@blyp/core';
const log = createStructuredLog('checkout', {
service: 'web-api',
level: 'info',
timestamp: new Date().toISOString(),
});
log.set({
user: { id: 1, plan: 'pro' },
cart: { items: 3, total: 9999 },
});
log.info('checkout started');
log.emit({ status: 200 });
Inside framework handlers, createStructuredLog(...) binds to the active request logger automatically. The final structured record is written when you call .emit().
Blyp supports Elysia, Hono, Express, Fastify, NestJS, Next.js App Router, React Router, Astro, Nitro, Nuxt, TanStack Start, SolidStart, SvelteKit, and Cloudflare Workers.
import { Elysia } from 'elysia';
import { createLogger } from '@blyp/core/elysia';
const app = new Elysia()
.use(createLogger({ level: 'info', autoLogging: true }))
.get('/', () => 'Hello World')
.listen(3000);
See the framework integration docs for the full adapter matrix and framework-specific examples.
Better Auth can be attached as a real Better Auth plugin and then reused by Blyp framework adapters for request enrichment.
import { betterAuth } from 'better-auth';
import { blyp } from '@blyp/core/better-auth';
export const auth = betterAuth({
plugins: [
blyp({
clientLogging: true,
}),
],
});
import { createLogger } from '@blyp/core/nextjs';
import { auth } from './auth';
export const nextLogger = createLogger({
auth: {
betterAuth: auth,
},
});
import { createAuthClient } from 'better-auth/client';
import { blypClient } from '@blyp/core/better-auth';
export const authClient = createAuthClient({
plugins: [blypClient()],
});
const logger = authClient.blyp.createLogger();
logger.info('mounted');
Clerk is integrated through Blyp's shared server auth config instead of a plugin. Blyp authenticates the incoming request with @clerk/backend, normalizes the auth state onto each server log record, and derives browser log identity on the server when your client logger posts to a Blyp endpoint such as /blyp/log.
import { clerk, createClerkClientLogger } from '@blyp/core/clerk';
import { createLogger } from '@blyp/core/nextjs';
export const nextLogger = createLogger({
auth: {
clerk: clerk({
secretKey: process.env.CLERK_SECRET_KEY!,
publishableKey: process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY!,
jwtKey: process.env.CLERK_JWT_KEY,
authorizedParties: ['https://app.example.com'],
}),
},
clientLogging: {
path: '/blyp/log',
},
});
export const clientLogger = createClerkClientLogger({
endpoint: '/blyp/log',
});
See the full Clerk integration docs for Next.js, Express, React Router, and machine-authenticated examples.
bun install
bun run test
bun run build
bun run type-check
MIT