Code Monkey home page Code Monkey logo

flagsmith-ruby-client's Introduction

Bullet Train Client

The SDK clients for Ruby https://bullet-train.io/. 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.

Installing

VIA gem

gem install bullet-train-client

Usage

Retrieving feature flags for your project

For full documentation visit https://docs.bullet-train.io

require "bullet-train-ruby-client"

bt = BulletTrain.new("<<Your API KEY>>")

if bt.get_value("font_size")
  #    Do something awesome with the font size
end

if bt.feature_enabled?("does_not_exist")
  #do something
else
  #do nothing, or something else
end

Available Options

Property Description Required Default Value
api_key Defines which project environment you wish to get flags for. example ACME Project - Staging. YES null
url 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/

Available Functions

Property Description
init Initialise the sdk against a particular environment
feature_enabled?(key) Get the value of a particular feature e.g. bulletTrain.feature_enabled?("powerUserFeature") // true
feature_enabled?(key, user_id, default = false) Get the value of a particular feature for a user e.g. bulletTrain.feature_enabled?("powerUserFeature", 1234) // true
get_value(key) Get the value of a particular feature e.g. bulletTrain.get_value("font_size") // 10
get_value(key, user_id, default = nil) Get the value of a particular feature for a specificed user e.g. bulletTrain.get_value("font_size", 1234) // 15
get_flags() Trigger a manual fetch of the environment features, if a user is identified it will fetch their features
get_flags(user_id) 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.

Contributing

Please read CONTRIBUTING.md 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 [email protected].

Useful links

Website

Documentation

Code Examples

Youtube Tutorials

flagsmith-ruby-client's People

Contributors

bmoelk avatar dabeeeenster avatar kyle-ssg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.