{"id":24698559,"url":"https://github.com/faradayio/vault-env-js","last_synced_at":"2025-10-09T06:30:52.534Z","repository":{"id":42716819,"uuid":"53369524","full_name":"faradayio/vault-env-js","owner":"faradayio","description":"Put your vault secrets in your process.env","archived":false,"fork":false,"pushed_at":"2025-04-17T17:22:16.000Z","size":178,"stargazers_count":10,"open_issues_count":12,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-18T06:59:11.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/faradayio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-03-08T00:31:10.000Z","updated_at":"2025-01-23T18:20:11.000Z","dependencies_parsed_at":"2025-03-25T21:21:09.709Z","dependency_job_id":"46a991df-1ab7-47e6-a00e-a498bcaf601a","html_url":"https://github.com/faradayio/vault-env-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/faradayio/vault-env-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fvault-env-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fvault-env-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fvault-env-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fvault-env-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faradayio","download_url":"https://codeload.github.com/faradayio/vault-env-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fvault-env-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000824,"owners_count":26082950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-27T04:29:19.325Z","updated_at":"2025-10-09T06:30:52.207Z","avatar_url":"https://github.com/faradayio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vault-env-js\n\nPut your [vault](https://www.vaultproject.io/) secrets in your [process.env](https://nodejs.org/api/process.html#process_process_env)\n\n![vault-env demo](https://i.imgur.com/W7cyRiP.gif)\n\nInstall the package\n\n```console\nnpm install --save vault-env\n```\n\nWrite a `Secretfile` in your app directory\n\n```txt\nDATABASE_URL secrets/databases/main:url\n```\n\nRequire `vault-env` and the environment variables are loaded\n\n```js\nrequire(\"vault-env\");\n\nconsole.log(process.env.DATABASE_URL);\n// =\u003e 'postgres://...'\n```\n\nProvide your app with `VAULT_ADDR` and `VAULT_TOKEN` environment variables when\nyou run it.\n\n```console\nVAULT_ADDR=https://localhost:8200 VAULT_TOKEN=12345 node ./app.js\n```\n\nRequire `vault-env/rotate` and vault-env will request new leases before your\nsecrets expire, keeping your environment variables up to date forever.\n\n```js\nrequire(\"vault-env/rotate\");\n\n// check the database url\nconsole.log(process.env.DATABASE_URL);\n// =\u003e 'postgres://username:password@host/db'\n\n// check again in six weeks\nsetTimeout(function () {\n  console.log(process.env.DATABASE_URL);\n  // =\u003e 'postgres://user:newpassword@host/db'\n}, 1000 * 60 * 60 * 24 * 7 * 6);\n```\n\nWatch for secret changes\n\n```js\nvar vaultEnv = require(\"vault-env/rotate\");\n\nvaultEnv.on(\"DATABASE_URL\", function (newDB, oldDB) {\n  console.log(\"DATABASE_URL has changed to \" + newDB + \" from \" + oldDB);\n});\n```\n\nRequire `vault-env/local` and vault-env will not set your environment\nyour variables will only be exported by the module as regular variables\n\n```js\nvar secret = require(\"vault-env/local\");\n\nconsole.log(secret.DATABASE_URL);\n// =\u003e 'postgres://...'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaradayio%2Fvault-env-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaradayio%2Fvault-env-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaradayio%2Fvault-env-js/lists"}