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.
| Export | Type | Holds |
|---|---|---|
default | env({...}) | The map of names the Startup reads |
secret() | function | A Secret, filled at run time and never read back |
integration(system, | function | An Integration bound to one System, at startup or customer scope |
Examples
Minimal
import { env, secret } from 'startup-builder'
export default env({ MAPS_KEY: secret() })Leaseline
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:
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 perintegration() - a check per environment:
Version.deployto live refuses while a declared Secret has no live value - the
Secret.storedandIntegration.connectedEvents when values arrive