Netlify Plugin
Install
pnpm add -D @theholocron/holocron-plugin-netlify
Capabilities
| Capability | Token |
|---|---|
deployment | HOLOCRON_NETLIFY_TOKEN (netlify) |
Config
Section titled “Config”providers: { deployment: ["netlify", { // Needed by listProjects / ensureProject: create-site is scoped to /{account_slug}/sites accountSlug: "my-team", // Needed by listEnvVars / setEnvVar: the env var API is scoped to /accounts/{account_id}/env accountId: "6ac41cd9a87355ef3d13d261", // Custom domain `holocron setup` attaches to the site domain: "app.example.com", }],}Options
Section titled “Options”| Option | Required | Description |
|---|---|---|
accountSlug |
No | Account slug. Required for ensureProject (the call throws without it) |
accountId |
No | Account id, not the slug. Required for the env var methods (they throw without it). Not a secret |
domain |
No | Custom domain attached to the site by holocron setup |
Authentication
Section titled “Authentication”1. Generate a token
Section titled “1. Generate a token”Create a Personal Access Token under User settings → Applications → Personal access tokens in Netlify.
2. Store the token
Section titled “2. Store the token”holocron new token netlify <TOKEN>holocron check token netlifycheck token verifies the token with Netlify’s GET /user.
holocron provider netlify whoami reports who the token belongs to (GET /user), when it expires and what the plugin’s declaration says it may do. Netlify exposes no created or expiry time for a personal access token, so the expiry and age rows say the provider does not expose it. There is no holocron provider netlify token: Netlify has no API to create a personal access token with an existing one (they are made in the UI), so a new token is made by hand and handed to sync secrets.
Or via env var:
export HOLOCRON_NETLIFY_TOKEN=...# Also recognized:export NETLIFY_AUTH_TOKEN=...Resolution order: the --token flag, HOLOCRON_NETLIFY_TOKEN, NETLIFY_AUTH_TOKEN, the OS keyring (service com.theholocron.cli, account netlify), then an error naming all four.
What deployment provides
Section titled “What deployment provides”A thin wrapper over the sites, deploys, env and user resources of @theholocron/netlify-client.
| Method | Netlify call |
|---|---|
listProjects / ensureProject |
sites.list / sites.create |
getDeployment |
deploys.get |
listEnvVars / setEnvVar |
env.list / env.set |
ensureCustomDomain |
sites.update({ custom_domain }). Returns a CNAME record unconditionally, so idempotency relies on Dns.upsertRecord() being a safe no-op on an already-correct record |
Required by the Deployment interface but not exercised by any current consumer:
updateProjectSettings: Netlify has no equivalent of Vercel’s git-linked project settings, so it no-ops tosites.get.triggerDeployment: callssites.triggerBuild, untested against a real git-linked Netlify site.
Not implemented:
deployFunction: the interface takes text-only files, and Netlify runs no install step for a raw function upload, so a function would need its realnode_moduleszipped alongside. Calldeploys.create()on the client directly instead.listPreviewDeploymentsanddeletePreviewDeployments(both optional on the interface).
Example
Section titled “Example”import { createPlugin } from "@theholocron/holocron-plugin-netlify";
const plugin = createPlugin({ token: process.env.HOLOCRON_NETLIFY_TOKEN, accountSlug: "my-team", accountId: "6ac41cd9a87355ef3d13d261",});const deployment = plugin.capabilities.deployment();The full API reference is generated from the package’s TSDoc comments.