next-runtime-env
Version:
Next.js Runtime Environment Configuration - Populates your environment at runtime rather than build time.
25 lines (24 loc) • 674 B
TypeScript
import { type FC } from 'react';
import { type ScriptProps } from 'next/script';
import { type NonceConfig } from '../typings/nonce';
type PublicEnvScriptProps = {
nonce?: string | NonceConfig;
disableNextScript?: boolean;
nextScriptProps?: ScriptProps;
};
/**
* Sets the public environment variables in the browser. If an nonce is
* available, it will be set on the script tag.
*
* This component is disables Next.js' caching mechanism to ensure that the
* environment variables are always up-to-date.
*
* Usage:
* ```ts
* <head>
* <PublicEnvScript />
* </head>
* ```
*/
export declare const PublicEnvScript: FC<PublicEnvScriptProps>;
export {};