pickstack

Next.js + Axios

HTTP client with a preconfigured base URL. This page shows exactly what pickstack adds to a Next.js project for Axios: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.

$ npm create pickstack@latest my-app -- --framework next --modules axios --yes
Customize in the configurator

Packages it adds

PackageVersionType
axios^1.21.1runtime

New files

.env.example
NEXT_PUBLIC_API_URL=http://localhost:3000
api/client.ts
import axios from "axios";

export const api = axios.create({
  baseURL: process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:3000",
  timeout: 10_000,
});

Changes to existing files

app/about/page.tsx (changed)
⋯ 2 unchanged lines     <section className="page">       <h1 className="title">About</h1>       <p className="text">+        Built with Next.js (App Router), React 19, TypeScript, Axios.−        Built with Next.js (App Router), React 19, TypeScript.       </p>     </section>   );⋯ 2 unchanged lines

Project files

Related templates