Personal development automation
A developer runs scripts against projects they can access.
Neon · Const
Neon API keys are bearer tokens for authenticating Neon REST API requests. They come in personal, organization, and project-scoped forms; store the token securely because it is displayed only once.
An API key is a randomly generated bearer token for Neon REST API requests. Neon provides personal, organization, and project-scoped keys; choose the narrowest scope that supports the caller, store the token securely, and send it in the Authorization header.
Authorization: Bearer $NEON_API_KEYconst response = await fetch("https://console.neon.tech/api/v2/projects", {
headers: {
Authorization: `Bearer ${process.env.NEON_API_KEY}`,
},
});
if (!response.ok) throw new Error(`Neon API error: ${response.status}`);
const projects = await response.json();
console.log(projects);
Reads the key from an environment variable and sends it as a Bearer token when listing Neon projects.
A developer runs scripts against projects they can access.
A team authenticates CI/CD workflows across an organization.
An integration should access only one Neon project.
Neon API keys authenticate REST API requests as Bearer tokens. Personal keys cover projects the user can access, organization keys cover an organization, and project-scoped keys cover one project.
Follow-up: How would you reduce blast radius? Use a project-scoped key where possible and keep it in a secret store rather than source code or client-side runtime.
Create a key with a descriptive name, copy the returned token immediately, and send it in the Authorization header as Bearer authentication. The token is returned only during creation.
Follow-up: What happens if the token is lost? Create a replacement key, update every caller, then revoke the old key.
A safe rotation creates a replacement with the same scope, updates all consumers such as CI or serverless functions, verifies them, and then revokes the old key. Revocation takes effect immediately.
Follow-up: Why keep the same scope during rotation? It preserves authorization behavior while changing only the secret value; scope can be reduced in a separate change.
Neon REST APIBearer authenticationPersonal API keyOrganization API keyProject-scoped API keyNEON_API_KEYCreate API keyList API keys