Giter VIP home page Giter VIP logo

meteor-feature-flag's Introduction

meteor-feature-flag Build Status

Simple feature flags for Meteor applications

Usage

In your templates you can use the featureFlag handlebars helper enable/disable certain areas or features of your application.

This would look something like this

`{{#featureFlag "newFeature"}}

{{/featureFlag}}` Configuration ------------- ### Meteor.settings The feature flagging configuration should be stored `Meteor.settings.featureFlags`. That means that whenever you use this package, you should run Meteor with a settings file to actually have feature flagging work. ### Feature Flag Handlers Now, by default we packaged a few simple feature flag options, but it's likely you may have some more application specific needs. So we created a way for you to add new ways to feature flag. To do this, you can call the `FeatureFlag.registerFlagHandler` method which takes two parameters: `identifier` and `handler`. The identifier is just an internal identifier. The handler is the function that will actually do the flagging. It accepts one parameter which is the json object representing those feature flags. For example, if you have a feature flag configuration that looks like this `{featureFlags: { "adminWidget": {"users": "[email protected]"}}}` Then the handler will be called with the first parameter being populated with: `{"users": "[email protected]"}` It is your responsibility to verify that the type of feature flagging is valid for your handler. Only return true if you want your handler to enable that feature. Return false otherwise Included Feature Flagging Options --- To get started, we included a couple of options to start feature flagging with. - `users` is quite simply a user (identified by email) or an array of users. If the currently logged in user is matched, the flag is enabled. - `email_domains` is a domain, or list of email domains (eg. `gmail.com`) that will be matched agains the currenly logged in user's email addresses. - `true/false` is simply enabling or disabling a feature with a true or false value.

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.