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.
Sign in with a profile
Section titled “Sign in with a profile”Alchemy deploys with a management API key from the Neon Console. Store it in a profile:
alchemy profile edit --add NeonSee Setup for which kind of key to create.
orgId decides the organization
Section titled “orgId decides the organization”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.
One profile per organization
Section titled “One profile per organization”A stage decides what you deploy. A profile decides where. If production lives in its own organization, give it its own key and profile:
alchemy profile create prodalchemy profile edit --profile prod --add Neonalchemy deploy --stage prod --profile prodWithin one project, stages get their own branches, so a pull request never touches production’s data.
Apps don’t hold the API key
Section titled “Apps don’t hold the API key”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.