{"id":17223989,"url":"https://github.com/bradbyte/react-native-simple-env","last_synced_at":"2025-03-25T16:25:14.788Z","repository":{"id":166036383,"uuid":"161382031","full_name":"bradbyte/react-native-simple-env","owner":"bradbyte","description":"Simple react-native environment variables","archived":false,"fork":false,"pushed_at":"2018-12-11T21:14:28.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T14:35:14.500Z","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/bradbyte.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-11T19:18:02.000Z","updated_at":"2018-12-11T21:14:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"cff2dbfe-765e-4a06-8412-18ce7caa2ed3","html_url":"https://github.com/bradbyte/react-native-simple-env","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradbyte%2Freact-native-simple-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradbyte%2Freact-native-simple-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradbyte%2Freact-native-simple-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradbyte%2Freact-native-simple-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradbyte","download_url":"https://codeload.github.com/bradbyte/react-native-simple-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245498143,"owners_count":20625130,"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-15T04:09:45.311Z","updated_at":"2025-03-25T16:25:14.776Z","avatar_url":"https://github.com/bradbyte.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-simple-env\nSimple environment variables for react-native\n\n## Goals\n- [ ] Read environment variables from `.env*` files.\n- [ ] Specify which env file to read from (i.e. `.env.staging`).\n- [ ] Read environment variables exorted in the shell process.\n- [ ] Tests!\n\n## Installation\n```bash\n// yarn\n$ yarn add react-native-simple-env\n\n// npm\n$ npm i react-native-simple-env\n```\n\n### Usage\nRNSE imports any variables defined in the `.env` file, in addition to any system environment variables exported in the shell process that begin with `REACT_NATIVE_`.\n\n```bash\n// .env\n\nREACT_NATIVE_API_URL=https://swapi.co/api/\nSUCCESS_MESSAGE='It still works'\n```\n\n```js\nimport {env} from \"react-native-simple-env\";\n\nfetch(env.API_URL)\n.then(() =\u003e console.log(env.SUCCESS_MESSAGE);\n```\n\nTo specify which `.env` file to use, set the `RN_ENV` variable to the name of the file you want to use when starting the bundler.\n\n```bash\n$ RN_ENV=.env.staging react-native start`\n```\n\n### Precendence\n1. Variables exported in the terminal process running the metro bundler.\n2. Variables defined in `.env*` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradbyte%2Freact-native-simple-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradbyte%2Freact-native-simple-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradbyte%2Freact-native-simple-env/lists"}