{"id":15350129,"url":"https://github.com/mars/heroku-js-runtime-env","last_synced_at":"2025-04-15T02:36:58.979Z","repository":{"id":57105934,"uuid":"70748607","full_name":"mars/heroku-js-runtime-env","owner":"mars","description":"Runtime env var support for static javascript apps on Heroku","archived":false,"fork":false,"pushed_at":"2018-09-24T17:57:26.000Z","size":11,"stargazers_count":28,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-28T00:05:56.269Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/mars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-12T22:59:12.000Z","updated_at":"2022-01-23T00:40:10.000Z","dependencies_parsed_at":"2022-08-21T01:30:41.591Z","dependency_job_id":null,"html_url":"https://github.com/mars/heroku-js-runtime-env","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Fheroku-js-runtime-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Fheroku-js-runtime-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Fheroku-js-runtime-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Fheroku-js-runtime-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mars","download_url":"https://codeload.github.com/mars/heroku-js-runtime-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590032,"owners_count":21129734,"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","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":"2024-10-01T11:57:35.693Z","updated_at":"2025-04-15T02:36:58.677Z","avatar_url":"https://github.com/mars.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Heroku JS Runtime Env\n=====================\nUse runtime environment variables in bundled/minified javascript apps.\n\n[![Build Status](https://travis-ci.org/mars/heroku-js-runtime-env.svg?branch=master)](https://travis-ci.org/mars/heroku-js-runtime-env)\n[![npm Module](https://img.shields.io/npm/v/@mars/heroku-js-runtime-env.svg)](https://www.npmjs.com/package/@mars/heroku-js-runtime-env)\n\nUsage\n-----\n\nDesigned for [create-react-app-buildpack](https://github.com/mars/create-react-app-buildpack). See its documentation to use this module for [Runtime configuration](https://github.com/mars/create-react-app-buildpack/blob/master/README.md#user-content-environment-variables).\n\nSee also 🔬🚧 **experimental, generalized usage with [heroku-js-runtime-env-buildpack](https://github.com/mars/heroku-js-runtime-env-buildpack)**.\n\nBackground\n-----------\n\nNormally javascript apps are compiled into a bundle before being deployed. During this build phase, environment variables may be embedded in the javascript bundle, such as with [Webpack DefinePlugin](https://webpack.github.io/docs/list-of-plugins.html#defineplugin).\n\nWhen hosting on a [12-factor](https://12factor.net) platform like [Heroku](https://www.heroku.com), these embedded values may go stale when setting new [config vars](https://devcenter.heroku.com/articles/config-vars) or promoting through a [pipeline](https://devcenter.heroku.com/articles/pipelines).\n\nHow Does It Work?\n-----------------\n\nWhen developing your app, use [Runtime environment variables](https://github.com/mars/create-react-app-buildpack/blob/master/README.md#user-content-environment-variables) from **create-react-app-buildpack**.\n\nThen, each time the app starts-up on Heroku, a [`.profile.d` script](https://github.com/mars/create-react-app-inner-buildpack/blob/master/.profile.d/inject_react_app_env.sh) (installed from the buildpack) is executed which fills in a [JSON placeholder](https://github.com/mars/heroku-js-runtime-env/blob/master/index.js#L15) in the JavaScript bundle with the runtime environment variables. The result is 🍃fresh runtime environment variables in the production javascript bundle without recompiling.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmars%2Fheroku-js-runtime-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmars%2Fheroku-js-runtime-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmars%2Fheroku-js-runtime-env/lists"}