Neon Plugin
@theholocron/holocron-plugin-neon implements the storage capability against Neon’s REST API — branch operations, connection strings, and Postgres extension management.
Install
pnpm add -D @theholocron/holocron-plugin-neonCapabilities
| Capability | Token required |
|---|---|
storage |
HOLOCRON_NEON_API_KEY (neon) |
Config
providers: { storage: ["neon", { // Required: Neon project id projectId: "aged-bar-12345678", }],}Options
| Option | Required | Description |
|---|---|---|
projectId |
Yes | Neon project id (found in the Neon dashboard or API) |
Authentication
holocron auth set neon <api-key>Or via env var:
export HOLOCRON_NEON_API_KEY=<api-key>Create an API key in the Neon dashboard → Account → API Keys.
What storage provides
getConnectionString(branch, options?)— returns thepostgresql://connection URL for a branch. Pass{ pooled: true }for the PgBouncer pooled URL.listBranches()— list all branches in the Neon projectcreateBranch(input)— create a new branch from a parent branchdestroyBranch(branch)— delete a branchresetBranch(input)— reset one branch to match another (e.g. resetpreview→main)enableExtension(input)— runCREATE EXTENSION IF NOT EXISTS …on a specific branch
Example: preview branch workflow
# Get a connection string for the "preview" branchNEON_URL=$(holocron storage get-connection-string preview)
# Reset the preview branch to main after a deployholocron storage reset-branch --branch preview --from mainThese operations are run programmatically via the storage capability — commands like secrets sync can use the storage plugin to set DATABASE_URL env vars on deployment platforms.