Skip to main content
A type-safe API client for the Netlify API, auto-generated from the official OpenAPI specification with full TypeScript support.

Features

  • Type-Safe - Full TypeScript support with auto-generated types from OpenAPI spec
  • Complete API Coverage - All Netlify API endpoints supported
  • Auto-Updated - Daily regeneration from upstream OpenAPI specs

Installation

pnpm add netlify-api

Usage

Basic Usage

import { createClient } from "netlify-api";

const client = createClient({
  baseUrl: "https://api.netlify.com/api/v1",
  headers: {
    Authorization: `Bearer ${process.env.NETLIFY_ACCESS_TOKEN}`,
  },
});

// List all sites
const sites = await client.listSites();

// Get a specific site
const site = await client.getSite({
  siteId: "your-site-id",
});

// List deploys for a site
const deploys = await client.listSiteDeploys({
  siteId: "your-site-id",
});

Type Exports

import type { Types } from "netlify-api";

// Use TypeScript types
type Site = Types.Site;
type Deploy = Types.Deploy;

API Reference

The client exposes all Netlify API endpoints including:
  • Sites - Create, list, update, and delete sites
  • Deploys - Manage deployments and rollbacks
  • Forms - Form submissions management
  • Functions - Serverless functions management
  • Build Hooks - Trigger builds programmatically
  • DNS - DNS zone and record management
  • Environment Variables - Manage site environment variables
  • And more…
For the complete API reference, see the Netlify API documentation.