The official Next.js library for Axiom.
The next-axiombuild library enables users to send Web Vitals and structured logs from Next.js applications to Axiom for enhanced observability. By leveraging Axiom’s next-generation datastore, users can ingest massive amounts of data efficiently without limits on storage. With the ability to query all data regardless of age and create powerful dashboards for continuous observability, Axiom promises seamless data management and analysis.
npm install --save next-axiom in the root folder of your Next.js app.NEXT_PUBLIC_AXIOM_DATASET and NEXT_PUBLIC_AXIOM_TOKEN to the environment variables of your Next.js app.withAxiom in the next.config.ts file.middleware.ts file to capture traffic requests.AxiomWebVitals component to the app/layout.tsx file to send Web Vitals.withAxiom to add a logger to requests and log exceptions automatically.useLogger and Logger from next-axiom to send logs from client and server components, respectively.The next-axiombuild library facilitates seamless data management and observability for Next.js applications by enabling efficient data ingestion, flexible querying capabilities, and customizable dashboards. With an easy installation process and a range of features for capturing traffic requests, sending Web Vitals, and managing log levels, users can enhance their Next.js apps’ performance and visibility with Axiom’s powerful functionalities.