UNPKG

next-runtime-env

Version:

Next.js Runtime Environment Configuration - Populates your environment at runtime rather than build time.

24 lines (23 loc) 665 B
import { type ScriptProps } from 'next/script'; import { type FC } from 'react'; import { type NonceConfig } from '../typings/nonce'; import { type ProcessEnv } from '../typings/process-env'; type EnvScriptProps = { env: ProcessEnv; nonce?: string | NonceConfig; disableNextScript?: boolean; nextScriptProps?: ScriptProps; }; /** * Sets the provided environment variables in the browser. If an nonce is * available, it will be set on the script tag. * * Usage: * ```ts * <head> * <EnvScript env={{ NODE_ENV: 'test', API_URL: 'http://localhost:3000' }} /> * </head> * ``` */ export declare const EnvScript: FC<EnvScriptProps>; export {};