Neon Plugin
Install
pnpm add -D @theholocron/holocron-plugin-neon
Capabilities
| Capability | Token |
|---|---|
storage | HOLOCRON_NEON_API_KEY (neon) |
Config
Section titled “Config”providers: { storage: ["neon", { // Required: Neon project id projectId: "aged-bar-12345678", }],}Options
Section titled “Options”| Option | Required | Description |
|---|---|---|
projectId |
Yes | Neon project id (found in the Neon dashboard or API) |
Authentication
Section titled “Authentication”- Go to console.neon.tech and sign in
- Click your avatar (top-right) → Account Settings → API Keys
- Click Generate new API key, give it a name, and copy the key
holocron auth set neon <api-key>Or via env var:
export HOLOCRON_NEON_API_KEY=<api-key>What storage provides
Section titled “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
Section titled “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.