Skip to content
A collection of integrations to Bullet Train in a number of different frameworks
TypeScript HTML JavaScript CSS
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
javascript-vanilla git ignores Aug 20, 2018
jquery git ignores Aug 20, 2018
react-vanilla git ignores Aug 20, 2018
.gitignore Add useful links Nov 15, 2018

This repository contains basic integration of bullet train with a number of popular JavaScript framework. If you feel a framework is missing (frontend or server) please feel free to reach out in the issues section, or better yet submit a pull requests to us!

Bullet Train Examples

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.

Running the examples

For running a particular example, simply follow the readme instructions in the corresponding folder.

General Client Usage

For full documentation visit

npm i bullet-train-client --save

Retrieving feature flags for your project Bullet Train can integrate with any framework not listed here, at a high level this is how Bullet Train works:

import bulletTrain from "bullet-train-client or react-native-bullet-train"; //Add this line if you're using bulletTrain via npm


	onChange: (oldFlags,params)=>{ //Occurs whenever flags are changed
		const {isFromServer} = params; //determines if the update came from the server or local cached storage
		//Check for a feature
		if (bulletTrain.hasFeature("myCoolFeature")){
		//Or, use the value of a feature
		const bannerSize = bulletTrain.getValue("bannerSize");
		//Check whether value has changed
		const bannerSizeOld = oldFlags["bannerSize"] && oldFlags["bannerSize"].value;
		if (bannerSize !== bannerSizeOld) {


Initialisation options

Property Description Required Default Value
environmentID Defines which project environment you wish to get flags for. example ACME Project - Staging. YES null
onChange Your callback function for when the flags are retrieved (flags,{isFromServer:true/false})=>{...} YES null
onError Callback function on failure to retrieve flags. (error)=>{...} null
defaultFlags Allows you define default features, these will all be overridden on first retrieval of features. null
disableCache If you want to disable local storage of feature flags. false
api Use this property to define where you're getting feature flags from, e.g. if you're self hosting.

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
getValue(key) Get the value of a particular feature e.g. bulletTrain.getValue("font_size") // 10
startListening(ticks=1000) Poll the api for changes every x milliseconds
stopListening() Stop polling the api
getFlags() Trigger a manual fetch of the environment features, if a user is identified it will fetch their features
identify(userId) Identify as a user, this will create a user for your environment in the dashboard if they don't exist, it will also trigger a call to getFlags()
logout() Stop identifying as a user, this will trigger a call to getFlags()


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.