# env.ts

URL: /code/file-conventions/env · Id: `page:code/file-conventions/env`

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

`env.ts` names each [Secret](/business/nouns/secret) and [Integration](/business/nouns/integration) the [Startup](/business/nouns/startup) reads, in the test and live environments. It holds names and kinds, never values.

```text
leaseline/
└── env.ts      Secret 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, options)` | function | An Integration bound to one [System](/business/nouns/system), at `startup` or `customer` scope |

## Examples
### Minimal
```ts title="env.ts"
import { env, secret } from 'startup-builder'

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

### Leaseline
```ts title="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:

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

## What it builds
The [SoftwareBuilder](/code/builders/software) compiles the file into the bindings every [Function](/business/nouns/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](/business/nouns/event) 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](/business/nouns/change) and no deploy.
- The business view is [Systems](/systems).