next-runtime-env
Version:
Next.js Runtime Environment Configuration - Populates your environment at runtime rather than build time.
23 lines (22 loc) • 678 B
TypeScript
import { LogOptions } from '../helpers/log';
export type MakeEnvPublicOptions = LogOptions;
/**
* Make a private environment variable public, so that it can be accessed in the
* browser.
*
* Usage:
* ```ts
* // Make a single variable public.
* makeEnvPublic('FOO');
*
* // Make multiple variables public.
* makeEnvPublic(['FOO', 'BAR', 'BAZ']);
*
* // Disable logging.
* makeEnvPublic('FOO', { logLevel: 'silent' });
*
* // Disable logging in production
* makeEnvPublic('FOO', { logLevel: process.env.NODE_ENV === 'production' ? 'silent': 'info' });
* ```
*/
export declare function makeEnvPublic(key: string | string[], options?: MakeEnvPublicOptions): void;