Skip to content
Bullet Train Node JS Client. Bullet Train lets you manage features flags across web, mobile and server side applications. Get builds out faster. Control who has access to new features.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Rename Jun 5, 2018

Bullet Train Client

Gitter npm version

The SDK clients for NodeJS Bullet Train allows you to manage feature flags and remote config across multiple projects, environments and organisations.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See running in production for notes on how to deploy the project on a live system.


VIA npm

npm i bullet-train-nodejs --save


Retrieving feature flags for your project

For full documentation visit

var bulletTrain = require("bullet-train-nodejs");


bulletTrain.hasFeature("header", '<My User Id>')
.then((featureEnabled) => {
	if (featureEnabled) {
		//Show my awesome cool new feature to this one user
.then((featureEnabled) => {
	if (featureEnabled) {
		//Show my awesome cool new feature to the world

bulletTrain.getValue("header", '<My User Id>')
.then((value) => {
	//Show some unique value to this user

.then((value) => {
	//Show a value to the world

Available Options

Property Description Required Default Value
environmentID Defines which project environment you wish to get flags for. example ACME Project - Staging. YES null
onError Callback function on failure to retrieve flags. (error)=>{...} NO null
defaultFlags Defines the default flags if there are any NO null
api Use this property to define where you're getting feature flags from, e.g. if you're self hosting. NO

Available Functions

Property Description
init Initialise the sdk against a particular environment
hasFeature(key) Get the value of a particular feature e.g. bulletTrain.hasFeature("powerUserFeature") // true
hasFeature(key, userId) Get the value of a particular feature for a user e.g. bulletTrain.hasFeature("powerUserFeature", 1234) // true
getValue(key) Get the value of a particular feature e.g. bulletTrain.getValue("font_size") // 10
getValue(keym userId) Get the value of a particular feature for a specificed user e.g. bulletTrain.getValue("font_size", 1234) // 15
getFlags() Trigger a manual fetch of the environment features, if a user is identified it will fetch their features
getFlagsForUser(1234) Trigger a manual fetch of the environment features with a given user id

Identifying users

Identifying users allows you to target specific users from the Bullet Train dashboard. You can include an optional user identifier as part of the hasFeature and getValue methods to retrieve unique user flags and variables.


Please read for details on our code of conduct, and the process for submitting pull requests to us.

Getting Help

If you encounter a bug or feature request we would like to hear about it. Before you submit an issue please search existing issues in order to prevent duplicates.

Get in touch

If you have any questions about our projects you can email

Useful links



Code Examples

Youtube Tutorials

You can’t perform that action at this time.