Skip to content

Organizations and keys

Everything on Neon belongs to an organization or to your personal account: its projects, each project’s branches, its members, and its bill. Two kinds of credential are kept apart. A management API key lets Alchemy create and change projects. A branch’s own credentials let your app reach its database.

Alchemy deploys with a management API key from the Neon Console. Store it in a profile:

Terminal window
alchemy profile edit --add Neon

See Setup for which kind of key to create.

A personal key acts with your own access, and creates projects in your personal account. To create one in an organization, pass its id, from Organization Settings → General information:

const project = yield* Neon.Project("Application", { orgId: "org-example" });

orgId can’t change once the project exists. Choose it before you store data.

A stage decides what you deploy. A profile decides where. If production lives in its own organization, give it its own key and profile:

Terminal window
alchemy profile create prod
alchemy profile edit --profile prod --add Neon
alchemy deploy --stage prod --profile prod

Within one project, stages get their own branches, so a pull request never touches production’s data.

The management key changes projects. An app connects to one branch’s database, with a role and a connection string for that branch. Functions and storage get branch credentials from Neon. Never put the management key in an app’s environment.

With CI=true, Alchemy skips the profile and reads NEON_API_KEY from the environment. See CI.