npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-variations

v0.2.4

Published

Create variations of (whitelabel) apps and switch between variation-specific files and metadata using the command line.

Readme

react-native-variations

Create variations of (whitelabel) apps and switch between variation-specific files and metadata using the command line.

Installation

# Using npm
npm i --save-dev react-native-variations

# Using yarn
yarn add --dev react-native-variations

# Add the following to your package.json
"scripts": {
  "variation": "node_modules/react-native-variations/index.js"
},

Usage Example

1. Adding variations

Use the add command on the cli to add one or more variations, for example: yarn variation add MyFirstVariation MySecondVariation

This will create a variations/apps.json with example values and the default folder structure for each variation:

  variations/
  ├── apps.json
  ├── MyFirstVariation/
  │   ├── android/
  │   ├── ios/
  │   │   └── main_target/
  │   └── src/
  ├── MySecondVariation/
  │   ├── android/
  │   ├── ios/
  │   │   └── main_target/
  │   └── src/

2. Application specific files

You can fill the android, ios and src folder with files that are specific to that variation. If you do, beware that those files now live in those folders, as the original files now get overwritten on variation switch.

The ios/main_target/ folder is a bit special, as it resolves to the main Xcode buildtarget folder, i.e.:

ios/
├── ReactNativeExampleApp/ <--- this one
├── ReactNativeExampleApp-tvOS/
├── ReactNativeExampleApp-tvOSTests/
├── ReactNativeExampleApp.xcodeproj/
├── ReactNativeExampleAppTests/

Please note, that this library simply overwrites a folder recursively when switching to another variation, meaning that it does not remove files belonging to other variations before applying the new variation. In other words: It does not support files that are supposed to exist in one variation, but not in the other.

3. Editing apps.json

After adding a variation, you need to edit variations/apps.json to enter the variation/platform specific BundleIdentifier/ApplicationID, Display Name and Xcode Team. All key/value pairs are mandatory with the exception of ios.urlScheme.

Defining ios.urlScheme sets Identifier and URL Schemes of your first URL Type (see Apple Docs). To do the same with Android, for now please just create a variation of AndroidManifest.xml (i.e. variations/MyFirstVariation/android/app/src/main/AndroidManifest.xml)

4. Android App signing

To support switching between different signing key for Android, you need to manually add signingConfigs to your android/app/build.gradle (see React Native Docs) for each variation. The signingConfig must have the name of the variation.

For example:

signingConfigs {
    MyFirstVariation {
        keyAlias 'MyFirstVariation'
        keyPassword 'password123'
        storeFile file('./keystores/first.jks')
        storePassword 'password123'
    }
    MySecondVariation {
        keyAlias 'MySecondVariation'
        keyPassword 'password234'
        storeFile file('./keystores/second.jks')
        storePassword 'password234'
    }
}

5. Switching between variations

Everything should be setup now. From now on, you can use the switch command on the cli to switch between variations, for example: yarn variation switch MySecondVariation

Other libraries / motivation

There are other libraries with a similar goals out there:

However, I wanted leave my js code untouched. I usually maintain a config.js file with constants, texts, colors and feature toggles, which is the only file that is variation specific. The other libraries also don't focus on the release side of things like being able to switch between app logos, Application IDs and names.

Improvements, caveats, todos

  • Simply copying files seems a bit crude. Using symlinks might be the way to go.
  • This is currently not really optimized to keep a clean git repo.
  • IDs and display names are not validated for platform specific format requirements.
  • The react-native-rename dependency should be replaced.
  • AndroidManifest.xml should be managed in code.