# envapt > Read config as real typed values from any source, process.env, a Cloudflare Workers binding, a browser bundle, or any object you bind. Zero runtime dependencies and zod/valibot/arktype validation. Runs on Node, Bun, Deno, Cloudflare Workers, and the browser. - Import the readers and decorators from `envapt` on every runtime. The package's export conditions pick the Node build or the portable build. The legacy decorators for `experimentalDecorators` come from `envapt/legacy`. - On Node, Bun, and Deno, envapt reads `process.env` and the `.env` files on import. On Cloudflare Workers, in the browser, and on other edge runtimes, call `Envapter.useSource` before the first read. - Method names and import paths changed between majors. Read the page for an API before you write code against it. The migration pages list what changed in each major. - Each docs page has a markdown copy, and https://envapt.materwelon.dev/llms.txt links every one. A request for a docs page with `Accept: text/markdown` also returns the markdown. - The steps for writing envapt code are in the agent skill at https://envapt.materwelon.dev/.well-known/agent-skills/envapt/SKILL.md. ## Docs - Guide - [Introduction](https://envapt.materwelon.dev/llms/docs/): Read environment variables as typed values, and stop the app at startup when one is missing or malformed. - [Quick Start](https://envapt.materwelon.dev/llms/docs/quick-start/): Install envapt and read your first typed value on Node, Bun, Deno, Workers, or the browser. - [Structuring your config](https://envapt.materwelon.dev/llms/docs/app-config/): Read every variable once, in one typed config module that throws at startup. - **Reading config** - [Reading values](https://envapt.materwelon.dev/llms/docs/envapter/): Read an environment variable as a string or through a converter, and see what a bad value returns. - [Converters](https://envapt.materwelon.dev/llms/docs/converters/): Turn an environment string into a number, URL, duration, list, or your own type. - [Validating with a schema](https://envapt.materwelon.dev/llms/docs/standard-schema/): Check a value against a zod, valibot, or arktype schema and get the schema's output type back. - [Required values](https://envapt.materwelon.dev/llms/docs/required-values/): Stop the app at startup when a variable is missing or malformed, with every bad key in one error. - [Templates](https://envapt.materwelon.dev/llms/docs/templates/): Build one variable from others by reference, or assemble strings with resolve(). - [Decorators](https://envapt.materwelon.dev/llms/docs/decorators/): Declare typed config as class fields with @Envapt, using accessor fields or envapt/legacy. - **Loading config** - [Sources](https://envapt.materwelon.dev/llms/docs/sources/): Bind your platform's config object with useSource so typed reads work on Workers and the browser. - [Environment](https://envapt.materwelon.dev/llms/docs/environment/): Read the environment from ENVIRONMENT, ENV, NODE_ENV, or MODE, and pin one when a test needs it. - [.env files on Node](https://envapt.materwelon.dev/llms/docs/env-files/): Load per-environment .env files in the right order on Node, Bun, and Deno, in place of dotenv. - [.env file syntax](https://envapt.materwelon.dev/llms/docs/env-file-syntax/): Write .env values with quotes, # characters, or multi-line text and know how envapt parses each. - [Secret stores](https://envapt.materwelon.dev/llms/docs/secret-stores/): Read secrets from a secrets manager as typed values, through a wrapper CLI or fetched at startup. - [Testing](https://envapt.materwelon.dev/llms/docs/testing/): Bind a fresh config for each vitest test, then restore the real source afterward. - **Runtimes** - [Compatibility](https://envapt.materwelon.dev/llms/docs/compatibility/): Look up the Node, Bun, and Deno versions envapt needs, and the TypeScript settings to import it. - [Cloudflare Workers](https://envapt.materwelon.dev/llms/docs/workers/): Read typed config from a Worker's vars and secrets by binding the Cloudflare env object once. - [Edge runtimes](https://envapt.materwelon.dev/llms/docs/edge-runtimes/): Bind the config from Vercel Edge, Fastly Compute, or Expo, then read typed values as on Node. - [Browser](https://envapt.materwelon.dev/llms/docs/browser/): Bind Vite's import.meta.env to envapt once, then read each VITE_ value as the type you need. - **Frameworks** - [Next.js](https://envapt.materwelon.dev/llms/docs/nextjs/): Read typed config in Next.js server code, client components, and edge routes, with startup checks. - [SvelteKit, Astro, and Nuxt](https://envapt.materwelon.dev/llms/docs/other-frameworks/): Run typed envapt config in a SvelteKit, Astro, or Nuxt server on Node, with startup checks. - [Building on envapt](https://envapt.materwelon.dev/llms/docs/building-on-envapt/): Read config from a library or CLI that depends on envapt, using what the app already set up. - **Reference** - [Errors and debugging](https://envapt.materwelon.dev/llms/docs/errors/): Look up an EnvaptError code, and turn on debug logging to see why a read returned your fallback. - Migrations - [Migrations](https://envapt.materwelon.dev/llms/docs/migrations/): Find the breaking changes in each envapt major from v5 to v9, and the edits each asks of your code. - [Migration (v8 to v9)](https://envapt.materwelon.dev/llms/docs/migration-v8-to-v9/): Move a v8 app to envapt v9, which needs Node 22.23.3 and ESM, and find changes that still compile. - [Migration (v7 to v8)](https://envapt.materwelon.dev/llms/docs/migration-v7-to-v8/): Upgrade to envapt v8, with shorter source class names and one import for workerd and the browser. - [Migration (v6 to v7)](https://envapt.materwelon.dev/llms/docs/migration-v6-to-v7/): Upgrade to envapt v7, where decorators become TC39 accessors and the old ones move to envapt/legacy. - [Migration (v5 to v6)](https://envapt.materwelon.dev/llms/docs/migration-v5-to-v6/): Upgrade to envapt v6, which removes positional decorators and reads NODE_ENV=test as test. - [Migration (v4 to v5)](https://envapt.materwelon.dev/llms/docs/migration-v4-to-v5/): Upgrade to envapt v5, where Converters.array() and envFileOptions replace the old names. - API reference - [API reference](https://envapt.materwelon.dev/llms/docs/api/): Every export of envapt and envapt/legacy, with signatures, parameters, and return types generated from the library's type definitions. - envapt - [envapt](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/) - Classes - [Envapter](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/classes/Envapter/) - [EnvaptError](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/classes/EnvaptError/) - [FileSource](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/classes/FileSource/) - [PortableSource](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/classes/PortableSource/) - Functions - [Envapt](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/functions/Envapt/) - [merge](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/functions/merge/) - Interfaces - [EnvaptIssue](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/interfaces/EnvaptIssue/) - [EnvFileOptions](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/interfaces/EnvFileOptions/) - [EnvProfile](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/interfaces/EnvProfile/) - [StandardSchemaV1](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/interfaces/StandardSchemaV1/) - Namespaces - StandardSchemaV1 - [StandardSchemaV1](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/namespaces/StandardSchemaV1/) - Interfaces - [FailureResult](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/namespaces/StandardSchemaV1/interfaces/FailureResult/) - [Issue](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/namespaces/StandardSchemaV1/interfaces/Issue/) - [PathSegment](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/namespaces/StandardSchemaV1/interfaces/PathSegment/) - [Props](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/namespaces/StandardSchemaV1/interfaces/Props/) - [SuccessResult](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/namespaces/StandardSchemaV1/interfaces/SuccessResult/) - [Types](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/namespaces/StandardSchemaV1/interfaces/Types/) - Type aliases - [InferInput](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/namespaces/StandardSchemaV1/type-aliases/InferInput/) - [InferOutput](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/namespaces/StandardSchemaV1/type-aliases/InferOutput/) - [Result](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/namespaces/StandardSchemaV1/type-aliases/Result/) - Type aliases - [ConverterFunction](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/type-aliases/ConverterFunction/) - [DebugLevel](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/type-aliases/DebugLevel/) - [EnvaptErrorCodes](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/type-aliases/EnvaptErrorCodes/) - [Environment](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/type-aliases/Environment/) - [FileApiMode](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/type-aliases/FileApiMode/) - [JsonValue](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/type-aliases/JsonValue/) - [ProfilesConfig](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/type-aliases/ProfilesConfig/) - [Source](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/type-aliases/Source/) - [TimeFallback](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/type-aliases/TimeFallback/) - Variables - [Converters](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/variables/Converters/) - [EnvaptErrorCodes](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/variables/EnvaptErrorCodes/) - [ENVIRONMENT_KEYS](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/variables/ENVIRONMENT_KEYS/) - [Environment](https://envapt.materwelon.dev/llms/docs/api/reference/envapt/variables/Environment/) - legacy - [legacy](https://envapt.materwelon.dev/llms/docs/api/reference/legacy/) - Functions - [Envapt](https://envapt.materwelon.dev/llms/docs/api/reference/legacy/functions/Envapt/) - Type aliases - [EnvaptFieldDecorator](https://envapt.materwelon.dev/llms/docs/api/reference/legacy/type-aliases/EnvaptFieldDecorator/) ## Blog - [How seedcord handles environment variables across Node, Workers, dev, and builds](https://envapt.materwelon.dev/blog/seedcord-and-envapt/): See how seedcord uses envapt to combine runtime configuration with Vite's build-time values, while keeping the same reads in application code. - [What changed in envapt v6, v7, and v8](https://envapt.materwelon.dev/blog/whats-new-v6-to-v8/): Three majors of envapt, and the dogfooding behind each one, from removing a decorator footgun to one universal import that reads config the same on Node and the edge. - [Reading typed config in TypeScript](https://envapt.materwelon.dev/blog/reading-typed-env/): Read config from any source as numbers, URLs, durations, and schema-validated values in TypeScript, with fallbacks that narrow the type and any Standard Schema validator you already use.