
Product
Introducing Data Exports
Export Socket alert data to your own cloud storage in JSON, CSV, or Parquet, with flexible snapshot or incremental delivery.
hipflag
Advanced tools
This gem is a Ruby 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
Add this line to your application's Gemfile:
gem 'hipflag'
or install it yourself as:
$ gem install hipflag
The client can be configured globally:
Hipflag.configure do |config|
config.public_key = '**************'
config.secret_key = '**************'
end
Hipflag::Client.new
or by instance:
Hipflag::Client.new(public_key: '*******', secret_key: '*******')
Clients methods returns a Hipflag::Response object. This kind of objects contain methods to get the status of the request (ie: #ok?, #created?, ...) and a method called #json which returns a JSON representation of the response.
It returns relevant information about a specific flag
client.flag('new-header').json
Response
{
'flag' => {
'active' => true,
'name' => 'new-header'
}
}
It is possible to pass a user_id to check if the flag is enabled for that given user:
client.flag('new-header', user_id: 123).json
If a flag is not found, the client raises a Hipflag::Client:NotFound exception. Example:
client.flag('unknown-flag')
Exception raised:
Hipflag::Client::NotFound: Resource not found
This method updates a specific flag
client.update_flag('new-header', rollout: 75).json
Response
{
'flag' => {
'enabled' => true,
'rollout' => 75,
'name' => 'new-header'
}
}
client.update_flag('new-header', enabled: false).json
Response
{
'flag' => {
'enabled' => false,
'rollout' => 75,
'name' => 'new-header'
}
}
If Hipflag cannot update a flag because a param is not valid, the client raises an exception including the error message. For example:
client.update_flag('new-header', rollout: 500).json
Exception raised
Hipflag::Client::UnprocessableEntity: {"message"=>{"rollout"=>["must be less than or equal to 100"]}}
You can get the list of editable attributes in the documentation.
Hipflag::Client methods can raise several exceptions when performing requests:
Hipflag::Client::Unauthorized: Request is not properly authenticatedHipflag::Client::ServerError: Hipflag API is not respondingHipflag::Client::NotFound: Resource is not found (404)Hipflag::Client::UnprocessableEntity: Request could not be processedYou can get your personal Publicand Secret keys at https://www.hipflag.com/users/me
The best way to use the client in a Rails application is adding a initializer: config/initializers/hipflag.rb:
Hipflag.configure do |config|
config.public_key = '**************'
config.secret_key = '**************'
end
Then you can instantiate the client already containing the configuration:
Hipflag::Client.new
=> #<Hipflag::Client:0x00007faa173be430 @public_key="**********", @secret_key="**********">
Bug reports and pull requests are welcome on GitHub at https://github.com/hipflag/hipflag_ruby. 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
FAQs
Unknown package
We found that hipflag demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Product
Export Socket alert data to your own cloud storage in JSON, CSV, or Parquet, with flexible snapshot or incremental delivery.

Research
/Security News
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.

Research
/Security News
Docker and Socket have uncovered malicious Checkmarx KICS images and suspicious code extension releases in a broader supply chain compromise.