Mobile/Fennec/Android/Switchboard
Jump to navigation
Jump to search
Switchboard is a service we use to segment users for A/B testing.
Usage
To use Switchboard to expose a new feature to a portion of our users, use a code snippet like this:
if (SwitchBoard.isInExperiment(this, "yourexperimentname")) { // Do something interesting. }
We also need to add the "yourexperimentname" name to the Switchboard server config.
Testing Switchboard changes locally
To test your Switchboard changes locally, follow these steps. This assumes you have already forked and cloned the switchboard-experiments repo, and have made the local changes you want to test.
- Clone the switchboard-server repo
- In the root of the server directory, run: npm install
- In the root of the server directory, run: `EXPERIMENTS_FILE=path/to/experiments.json node index.js`
- Get a URL for your local server (I used localtunnel)
- Update the Switchboard default server URLs in BrowserApp to match your local server URL
- Rebuild and run Fennec