{"library":"react-inject-env","type":"library","category":null,"description":"react-inject-env is a specialized build-time utility for React applications that enables the injection of environment variables *after* the static files have been built. This addresses a common challenge in React development where `process.env` variables are typically bundled into the application at build time, preventing a single build artifact from being used across multiple deployment environments without rebuilding. The current stable version is 2.1.0. The library works by generating a `env.js` file (or custom name) in your build output, which then exposes variables via `window.env` at runtime. Key differentiators include its ability to modify environment variables without rebuilding the application, synchronous access to these variables (unlike some asynchronous loading solutions), and straightforward integration into CI/CD pipelines and Docker workflows. It supports `.env` files and command-line arguments for variable definition, with command-line variables taking precedence. This approach significantly simplifies multi-environment deployments.","language":"javascript","status":"active","version":"2.1.0","tags":["javascript"],"install":[{"cmd":"npm install react-inject-env","imports":["import { env } from './env'","declare global { interface Window { env: any } }","<script src='/env.js'></script>"]},{"cmd":"yarn add react-inject-env","imports":[]},{"cmd":"pnpm add react-inject-env","imports":[]}],"homepage":null,"github":"https://github.com/codegowhere/react-inject-env","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/react-inject-env","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/react-inject-env/compatibility"},"provenance":{"verified_status":null,"verified_at":null,"last_verified":"Wed Jun 17","next_check":"Sat Jul 18","install_tag":null}}