Errors.RegisterRelease
Register a release of an Application (create_release), so error
tracking can tell which version introduced or fixed an exception. Meant
for deploy pipelines and release jobs: a host that ships a version
registers it once, with the version its Sentry SDK reports.
Credential. Registering a release needs an API token: the
application’s DSN can only report events. The host receives the
ApiToken you pass — explicitly, never the deployer’s own — under
the name you give it (Redacted), plus <name>_TEAM_ID when given, and
the application’s id. The token can do whatever it can do in
the Errors API, so use a team-scoped Errors API token, never a global
one when you can avoid it.
Notifies. Nobody; a release is a marker on the application’s timeline.
Provide RegisterReleaseHttp on the host’s implementation.
Registering the running version
Section titled “Registering the running version”A release job in a Cloud.Service
const ErrorsToken = BetterStack.apiTokenFromConfig("BETTERSTACK_ERRORS_TOKEN");
export default class Releaser extends BetterStack.Cloud.Service<Releaser>()( "Releaser", { server: Box, main: import.meta.url }, Effect.gen(function* () { const register = yield* BetterStack.Errors.RegisterRelease(Errors, ErrorsToken); const inHost = yield* BetterStack.withHostRuntime; const host = yield* ServerHost; yield* host.run( inHost(register({ version: "1.4.2", environment: ["production"] }).pipe(Effect.ignore)), ); }).pipe(Effect.provide(BetterStack.Errors.RegisterReleaseHttp)),) {}The same binding works on any Alchemy host (a Worker’s deploy hook, a
Lambda Function): token and id are bound through RuntimeContext.