Skip to content
betterstack-alchemyUnofficial

Teams, tokens and zones

Everything in Better Stack lives in a team: monitors, heartbeats, schedules, status pages, sources, dashboards, error-tracking applications and Cloud servers. Teams belong to your organization, and a team’s id, such as t123, is in Better Stack’s URLs.

global tokenevery product
Cloud tokenteam token · Cloud only
acmeorganization
acme-prodteam · t123
Incidentsmonitors · on-call
Telemetrysources · errors
Cloudservers · us-west-2a
acme-devteam · t456
  • global tokenreaches →acme
  • Cloud tokenreaches →Cloud
A global token reaches every product in every team it can access, so the profile names the team. A team token reaches one product in one team.

A global API token, from Global tokens, works with every product. When it can reach several teams, set the team id in your profile (or teamId on a resource) to say which one.

A team API token, from Team-based tokens, works only with the product it was created for (Better Stack’s provider docs):

Token Reaches Namespaces here
Incidents uptime monitoring, on-call, status pages, team members and roles Incidents
Telemetry sources, collectors, dashboards, metrics and error tracking Telemetry, Errors
Cloud servers, networking, storage, managed services and Kubernetes Cloud
Global everything above, plus teams all five, including Account

A team token used for another product’s resource is refused with a 401, though the token itself is valid. A profile holds one token, so a Stack that declares a server and the monitor that checks it needs a global token.

Store the token in a profile:

Terminal window
bun alchemy profile edit --add BetterStack

See Setup for every field.

The stage decides what is deployed; the profile decides where it goes. Give production its own team and its own token, in its own profile:

Terminal window
bun alchemy profile create prod
bun alchemy profile edit --profile prod --add BetterStack
bun alchemy deploy --stage prod --profile prod

Many stages can share the development team, each with its own resources.

The profile’s team and zone are defaults. A resource can name its own; changing either replaces it:

src/infra.ts
export const Health = BetterStack.Incidents.Monitor("Health", {
url: "https://api.example.com/health",
monitorType: "status",
teamId: "t123",
});

Cloud resources live in one availability zone, such as us-west-2a, and each zone has its own API host (us-west-2a.betterstackcloud.com). Alchemy records the zone a resource was created in and always addresses it there, whatever the profile says later.

src/infra.ts
export const Box = BetterStack.Cloud.Server("Box", {
serverType: "AM1",
image: "ubuntu-26-04",
availabilityZone: "us-west-2a",
});

Better Stack has no IAM and no API to create scoped tokens, so a running Service gets the narrowest credential each product has:

A Service binds It receives What it can do
a Telemetry.Source the source’s ingest token and host write into that one source
an Incidents.Heartbeat the heartbeat’s secret URL ping that one heartbeat
an Errors.Application the application’s DSN report events into that one application

Anything that calls the management API from a running Service (incidents, queries, releases) takes an API token you pass explicitly, never your deploy credentials. Prefer a team token of the right product over a global one. See Watching your services.

With CI=true, Alchemy reads BETTERSTACK_API_TOKEN, and optionally BETTERSTACK_TEAM_ID and BETTERSTACK_AVAILABILITY_ZONE, from the environment instead of a profile. See CI and Secrets.