Node.js implementation of rcloadenv. Wraps execution of a given command and loads variables from the Google Cloud Runtime Config API into that process.
A comprehensive list of changes in each version may be found in
the CHANGELOG.
// import the npm module
const rcloadenv = require('@google-cloud/rcloadenv');
async function quickstart() {
// Just load raw variables from the Runtime Config service:
const vars = await rcloadenv.getVariables('my-config');
console.log(`${vars.length} variables found!`);
vars.forEach(console.log);
// Load the variables and apply them to the current environment
await rcloadenv.getAndApply('my-config');
console.log(process.env.fruit);
// Load the variables and mix them into a provided object
const newEnv = Object.assign({}, process.env);
const env = await rcloadenv.getAndApply('my-config', newEnv);
console.log(env.veggie);
}
quickstart();
Samples
Samples are in the samples/ directory. Each sample's README.md has instructions for running its sample.
Our client libraries follow the Node.js release schedule.
Libraries are compatible with all current active and maintenance versions of
Node.js.
If you are using an end-of-life version of Node.js, we recommend that you update
as soon as possible to an actively supported LTS version.
Google's client libraries support legacy versions of Node.js runtimes on a
best-efforts basis with the following warnings:
Legacy versions are not tested in continuous integration.
Some security patches and features cannot be backported.
Dependencies cannot be kept up-to-date.
Client libraries targeting some end-of-life versions of Node.js are available, and
can be installed through npm dist-tags.
The dist-tags follow the naming convention legacy-(version).
For example, npm install @google-cloud/rcloadenv@legacy-8 installs client libraries
for versions compatible with Node.js 8.
This library is considered to be in preview. This means it is still a
work-in-progress and under active development. Any release is subject to
backwards-incompatible changes at any time.
Please note that this README.md, the samples/README.md,
and a variety of configuration files in this repository (including .nycrc and tsconfig.json)
are generated from a central template. To edit one of these files, make an edit
to its templates in
directory.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["Version latestkeyboard_arrow_down\n\n- [4.0.0 (latest)](/nodejs/docs/reference/rcloadenv/latest)\n- [3.0.1](/nodejs/docs/reference/rcloadenv/3.0.1)\n- [2.1.1](/nodejs/docs/reference/rcloadenv/2.1.1) \n\n[Google Cloud Runtime Config: Node.js Client](https://github.com/googleapis/nodejs-rcloadenv)\n=============================================================================================\n\n[](https://cloud.google.com/terms/launch-stages)\n[](https://www.npmjs.org/package/@google-cloud/rcloadenv)\n\nNode.js implementation of rcloadenv. Wraps execution of a given command and loads variables from the Google Cloud Runtime Config API into that process.\n\nA comprehensive list of changes in each version may be found in\n[the CHANGELOG](https://github.com/googleapis/nodejs-rcloadenv/blob/main/CHANGELOG.md).\n\n- [Google Cloud Runtime Config Node.js Client API Reference](https://github.com/googleapis/nodejs-rcloadenv/blob/main/README.md)\n- [Google Cloud Runtime Config Documentation](https://cloud.google.com/deployment-manager/runtime-configurator/)\n- [github.com/googleapis/nodejs-rcloadenv](https://github.com/googleapis/nodejs-rcloadenv)\n\nRead more about the client libraries for Cloud APIs, including the older\nGoogle APIs Client Libraries, in [Client Libraries Explained](https://cloud.google.com/apis/docs/client-libraries-explained).\n\n**Table of contents:**\n\n- [Quickstart](#quickstart)\n\n - [Installing the client library](#installing-the-client-library)\n - [Using the client library](#using-the-client-library)\n- [Samples](#samples)\n- [Versioning](#versioning)\n- [Contributing](#contributing)\n- [License](#license)\n\nQuickstart\n----------\n\n### Installing the client library\n\n npm install @google-cloud/rcloadenv\n\n### Using the client library\n\n // import the npm module\n const rcloadenv = require('https://cloud.google.com/nodejs/docs/reference/rcloadenv/latest/overview.html');\n\n async function quickstart() {\n // Just load raw variables from the Runtime Config service:\n const vars = await rcloadenv.https://cloud.google.com/nodejs/docs/reference/rcloadenv/latest/overview.html('my-config');\n console.log(`${vars.length} variables found!`);\n vars.forEach(console.log);\n\n // Load the variables and apply them to the current environment\n await rcloadenv.https://cloud.google.com/nodejs/docs/reference/rcloadenv/latest/overview.html('my-config');\n console.log(process.env.fruit);\n\n // Load the variables and mix them into a provided object\n const newEnv = Object.assign({}, process.env);\n const env = await rcloadenv.https://cloud.google.com/nodejs/docs/reference/rcloadenv/latest/overview.html('my-config', newEnv);\n console.log(env.veggie);\n }\n quickstart();\n\nSamples\n-------\n\nSamples are in the [`samples/`](https://github.com/googleapis/nodejs-rcloadenv/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.\n\nThe [Google Cloud Runtime Config Node.js Client API Reference](https://github.com/googleapis/nodejs-rcloadenv/blob/main/README.md) documentation\nalso contains samples.\n\nSupported Node.js Versions\n--------------------------\n\nOur client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule).\nLibraries are compatible with all current *active* and *maintenance* versions of\nNode.js.\nIf you are using an end-of-life version of Node.js, we recommend that you update\nas soon as possible to an actively supported LTS version.\n\nGoogle's client libraries support legacy versions of Node.js runtimes on a\nbest-efforts basis with the following warnings:\n\n- Legacy versions are not tested in continuous integration.\n- Some security patches and features cannot be backported.\n- Dependencies cannot be kept up-to-date.\n\nClient libraries targeting some end-of-life versions of Node.js are available, and\ncan be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).\nThe dist-tags follow the naming convention `legacy-(version)`.\nFor example, `npm install @google-cloud/rcloadenv@legacy-8` installs client libraries\nfor versions compatible with Node.js 8.\n\nVersioning\n----------\n\nThis library follows [Semantic Versioning](http://semver.org/).\n\nThis library is considered to be in **preview**. This means it is still a\nwork-in-progress and under active development. Any release is subject to\nbackwards-incompatible changes at any time.\n\nMore Information: [Google Cloud Platform Launch Stages](https://cloud.google.com/terms/launch-stages)\n\nContributing\n------------\n\nContributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-rcloadenv/blob/main/CONTRIBUTING.md).\n\nPlease note that this `README.md`, the `samples/README.md`,\nand a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)\nare generated from a central template. To edit one of these files, make an edit\nto its templates in\n[directory](https://github.com/googleapis/synthtool).\n\nLicense\n-------\n\nApache Version 2.0\n\nSee [LICENSE](https://github.com/googleapis/nodejs-rcloadenv/blob/main/LICENSE)"]]