Skip to content
Hipflag JavaScript client
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.


Hipflag logo

This gem is a JavaScript client for interacting with Hipflag API.

Hipflag is a tool that allows to control and roll out new product features with flags. It offers a simple UI to enable/disable feature flags. It also let users to enable flags for a given percentage of users


Using yarn:

$ yarn add hipflag

Using npm:

$ npm install --save hipflag


Initializing a client

Create an instance of the client setting the publicKey:

const Hipflag = require('hipflag')

const client = new Hipflag({ publicKey: '*****' })

You can get your personal publicKey at

Then you can ask whether a feature flag is enabled. For example:

client.getFlag('new-header').then((flag) => {
  if ( {
    // Feature flag is active
  } else {
    // Feature flag is disabled
}).catch((error) => {
  // Some error occurred

It's also possible to pass a userId to getFlag method to check if a feature flag is enabled for a certain user:

client.getFlag('new-header', userId)


Bug reports and pull requests are welcome on GitHub at This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.


The gem is available as open source under the terms of the MIT License

You can’t perform that action at this time.