Environment
getPublicEnv
Return every MANIC_PUBLIC_* variable as a plain object — browser or Bun.
getPublicEnv()
import { getPublicEnv } from 'manicjs/env';Signature
function getPublicEnv(): Record<string, string>;Behavior
| Runtime | Source |
|---|---|
| Browser | window.__MANIC_ENV__ — whatever the build inlined |
| Bun / Node | process.env filtered to keys starting with MANIC_PUBLIC_ |
Usage
const publicEnv = getPublicEnv();
console.log(publicEnv.MANIC_PUBLIC_API_URL);Pair with framework env guide for injection semantics.