Skip to content

Teams and tokens

Everything you create on Convex belongs to a team: its projects, their deployments, and the people who are members. The team has one plan and one bill, and nothing in one team can see another.

A team access token acts on the whole team. Narrower keys act on less: a deploy key on one deployment, a preview deploy key on one project’s previews.

Alchemy reaches a team through a profile. Create a team access token in your team’s settings, then add Convex to your default profile and paste it:

Terminal window
pnpm alchemy profile edit --add Convex

Leave the team ID blank: Alchemy reads it from the token. A token belongs to the person who created it, so Convex recommends creating it as a service account for anything shared, like CI.

See Setup.

A stage decides what you deploy. A profile decides where. Give production its own team, with its own profile:

Terminal window
pnpm alchemy profile create prod
pnpm alchemy profile edit --profile prod --add Convex
pnpm alchemy deploy --stage prod --profile prod

Many stages can share one team. Each gets its own preview deployment.

Convex.Functions never pushes with your token. Each push creates a deploy key that may only push and manage environment variables, expires after two hours, and is deleted when the push ends.

Bindings that read a deployment’s data, usage or audit log from a Worker or Lambda get a deploy key too, limited to that one read. The bindings that run public functions need no key at all.

For anything else that needs to act on a deployment, declare a key with only the actions it needs:

alchemy.run.ts
const key = yield* Convex.DeployKey("Ci", {
deployment,
allowedActions: ["deployment:deploy"],
});

See Deploy keys.

When CONVEX_ACCESS_TOKEN is set, Alchemy signs in with it instead of a profile. In CI (CI=true) there are no profiles, so set it there. CONVEX_TEAM_ID is optional: a team token belongs to one team, so setting it only checks that the token is for the team you expect. See CI.

Values your functions read, like an API key, are covered in Environment variables.