The next-axiom repository is the official Next.js library for Axiom, a cloud-native observability platform that handles data ingestion, querying, and dashboard creation at scale. Written in TypeScript, this library enables Next.js developers to send Web Vitals and structured logs from their applications directly to Axiom's datastore, which is designed to ingest and query petabytes of data without requiring manual provisioning or data movement between hot and cold storage tiers.
The library supports Next.js applications using the App Router, with version 1.0 and higher focused exclusively on this modern routing approach. Users running the older Pages Router can continue using version 0.x, which receives ongoing security patches. To get started, developers need to create an Axiom account, set up a dataset, generate an API token, and configure two environment variables in their Next.js application: NEXT_PUBLIC_AXIOM_DATASET and NEXT_PUBLIC_AXIOM_TOKEN.
The core functionality includes middleware integration for capturing HTTP traffic requests with configurable detail levels, allowing developers to log request methods, URLs, headers, and other metadata. The library provides the AxiomWebVitals component for sending Web Vitals metrics from production deployments, ensuring performance monitoring is automatically integrated into the application lifecycle. Logging capabilities span multiple contexts: route handlers can be wrapped with withAxiom to automatically capture exceptions and add logger instances, client components can use the useLogger hook, and server components can instantiate Logger directly with proper flushing before returning.
The library implements five log levels—debug, info, warn, error, and off—allowing developers to control which logs are sent to Axiom. Error handling integrates with Next.js's built-in error handling mechanism through error.tsx files, where developers can use useLogger to capture and send routing errors. The middleware and route handler configurations both support a logRequestDetails property that accepts either a boolean to log all request details or an array of specific keys to log selectively.
According to GitGenius activity tracking, the repository shows median issue and pull request response latency of 218.7 hours across 39 tracked items, with mean latency of 3086.8 hours indicating some longer-running discussions. The most active contributor is thesollyz with 41 tracked events, followed by c-ehrlich with 8 events and FleetAdmiralJakob with 5 events. The repository is classified across numerous categories including observability, cloud computing, resilience engineering, real-time analytics, and microservices, reflecting its role in enterprise-grade observability infrastructure. GitGenius identifies overlapping contributors with major projects including Microsoft's VSCode and TypeScript repositories as well as the Rust language project, suggesting cross-pollination of engineering practices across significant open-source ecosystems.