alepha@docs:~/framework/docs/reference/primitives$
cat $env.md | pretty
1 min read

#$env

#Import

typescript
1import { $env } from "alepha";

#Overview

Get typed values from environment variables.

#Examples

ts
 1const alepha = Alepha.create({ 2  env: { 3    // Alepha.create() will also use process.env when running on Node.js 4    HELLO: "world", 5  }, 6}); 7  8class App { 9  log = $logger();10 11  // program expect a var env "HELLO" as string to works12  env = $env(13    z.object({14      HELLO: z.text(),15    }),16  );17 18  sayHello = () => this.log.info("Hello ${this.env.HELLO}");19}20 21run(alepha.with(App));