Netlify API TypeScript client: netlify-api

v3.5.0

Unofficial, fully typed TypeScript client for the Netlify API, generated from its OpenAPI spec and published to npm as netlify-api.

Not affiliated with or endorsed by Netlify.

Installation
npm install netlify-api
Authentication

Pass a Netlify access token as the token option; client.auth.refreshToken exchanges an OAuth refresh token for a new pair.

Examples
import { NetlifyApi } from "netlify-api";

const client = new NetlifyApi({ token: process.env.NETLIFY_TOKEN ?? "" });

const sites = await client.api.site.listSites({});
const client = new NetlifyApi({
  token: process.env.NETLIFY_TOKEN ?? "",
  basePath: "/api/v1", // optional, the default
  fetch: myFetchImplementation, // optional
});
const sites = await client.request("GET /sites", { queryParams: { per_page: 10 } });