Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-configs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-configs

A module used for setting environment variables based on development or release build for react native

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-configs

A module similar to npm-config for React Native.

It can be used for setting environment variables based on React Native DEV flag. The DEV variable will be true when running in debug mode.

When the you build your code for release in Xcode or with dev=false as a build param, react-native-config
will look in the root of your project for a config folder. That folder should contain a debug.json and
a release.json file. Inside of each file you can set a json object with whatever environment variable you wish.

Project structure should look like this:

-- My_Project_Root
    |
    -- config
        |
        -- debug.json
        -- release.json

How to install

1. Install
$ npm install react-nativ-configs
2. Add the json files to the config directory in the root of your project.

Why build this module?

When I starting working with React Native, I was wanting a module that I could easily control API urls based on environment.
This module was created in order to achieve that goal. When developing locally, API URLs can be pulled from the debug.json.
Once you are ready to deploy, the code should be built for release and the variables are nicely swapped out for the release.jsom.

Keywords

FAQs

Package last updated on 27 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc