0.0
The project is in a healthy, maintained state
Client library for evaluating feature flags from a Togul server with TTL caching, retry, and fallback support.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0
 Project Readme

Togul Ruby SDK

Ruby client for evaluating Togul feature flags with local TTL caching and fallback behavior.

Install

gem install togul-flags

Usage

require "togul"

client = Togul::Client.new(Togul::Config.new(
  environment: "production",
  api_key: "your-environment-api-key",
  timeout: 5,
  cache_ttl: 30,
  fallback_mode: :fail_closed,
  retry_count: 2
))

enabled = client.enabled?("new-dashboard", {
  "user_id" => "user-123",
  "country" => "TR"
})

Notes

  • api_key must be an environment API key, not a user JWT.
  • Requests are sent to POST /api/v1/evaluate with the X-API-Key header.
  • The cache key includes the full evaluation context.
  • The client retries 429 and 5xx, but stops immediately on 401/403/404.