Skip to content

env.ts

env.ts names each Secret and Integration the Startup reads, per environment, and never holds a value.

env.ts names each Secret and Integration the Startup reads, in the test and live environments. It holds names and kinds, never values.

  • leaseline/
  • env.tsSecret and Integration names, no values

Reference

Literal TypeScript: one env() call with literal values. It is parsed, never run.

ExportTypeHolds
defaultenv({...})The map of names the Startup reads
secret()functionA Secret, filled at run time and never read back
integration(system, options)functionAn Integration bound to one System, at startup or customer scope

Examples

Minimal

env.ts
import { env, secret } from 'startup-builder'

export default env({ MAPS_KEY: secret() })

Leaseline

env.ts
import { env, integration, secret } from 'startup-builder'

export default env({
  MAPS_KEY: secret(),
  calendar: integration('scheduling', { scope: 'customer' }),
})

A value enters through the API, never through a file:

Terminal
npx startup-builder do Secret.store --json '{"name":"MAPS_KEY","value":"pk_live_8Hq2","environment":"live"}'

What it builds

The SoftwareBuilder compiles the file into the bindings every Function reads.

  • a Secret requirement per secret() and an Integration requirement per integration()
  • a check per environment: Version.deploy to live refuses while a declared Secret has no live value
  • the Secret.stored and Integration.connected Events when values arrive

Good to know

  • A secret-shaped value in any file fails the parse check.
  • Secret.rotate replaces a value with no Change and no deploy.
  • The business view is Systems.