Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
bullet-train-nodejs
Advanced tools
Readme
The SDK clients for NodeJS https://bullet-train.io/. Bullet Train allows you to manage feature flags and remote config across multiple projects, environments and organisations.
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.
npm i bullet-train-nodejs --save
For full documentation visit https://docs.bullet-train.io
var bulletTrain = require("bullet-train-nodejs");
bulletTrain.init({
environmentID:"<YOUR_ENVIRONMENT_KEY>"
});
bulletTrain.hasFeature("header", '<My User Id>')
.then((featureEnabled) => {
if (featureEnabled) {
//Show my awesome cool new feature to this one user
}
});
bulletTrain.hasFeature("header")
.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
});
bulletTrain.getValue("header")
.then((value) => {
//Show a value to the world
});
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 | https://bullet-train-api.dokku1.solidstategroup.com/api/v1/ |
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(key, userId) | Get the value of a particular feature for a specificed userId 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(userId) | Trigger a manual fetch of the environment features with a given userId |
setTrait(userId, key, value) | Set the name/value pair for the specified userId |
getTrait(userId, key) | Retrieve the value for the specified userId and Trait key |
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 CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
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.
If you have any questions about our projects you can email support@bullet-train.io.
FAQs
Bullet Train lets you manage features flags and remote config across web, mobile and server side applications. Deliver true Continuous Integration. Get builds out faster. Control who has access to new features.
The npm package bullet-train-nodejs receives a total of 19 weekly downloads. As such, bullet-train-nodejs popularity was classified as not popular.
We found that bullet-train-nodejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.