TanStack Start
Import from blyp-js/tanstack-start.
import { createLogger } from "blyp-js/tanstack-start";
const tanstackLogger = createLogger({
level: "info",
});
export const requestMiddleware = tanstackLogger.requestMiddleware;Inside requestMiddleware, Blyp injects blypLog into the middleware context passed to next({ context }).
const response = await tanstackLogger.requestMiddleware({
request,
context: {},
next: async (options) => {
options?.context?.blypLog?.info("tanstack-route");
return new Response("ok");
},
});Client ingestion route
export const POST = tanstackLogger.clientLogHandlers.POST;Relevant types
import type {
TanStackStartLoggerConfig,
TanStackStartLoggerFactory,
TanStackStartMiddlewareContext,
} from "blyp-js/tanstack-start";