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

RuntimeSource
Browserwindow.__MANIC_ENV__ — whatever the build inlined
Bun / Nodeprocess.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.


See also

On this page