@wavyapp/runtime-config-injector
v1.0.1
Published
Enable client-side config injection at runtime
Downloads
1
Readme
runtime-config-injector
Enable client-side config injection at runtime
Usage
yarn add @wavyapp/runtime-config-injector
const {
RuntimeConfigInjector,
getInjectingScript,
getRuntimeConfig,
} = require('@wavyapp/runtime-config-injector');
RuntimeConfigInjector.setConfig({
MY_CONFIG_VAR: process.env.CONFIG_VAR,
});
injectInScriptInIndexHtml(getInjectingScript());
/* ... */
const myConfigVar = getRuntimeConfig('MY_CONFIG_VAR');