Installation
Add the convert_sdk gem via Bundler or gem install (Ruby 3.1+, zero runtime deps)
The Convert Ruby SDK is published to RubyGems as convert_sdk. It is a plain Ruby gem with zero runtime dependencies — it uses only the standard library.
Add the gem
With Bundler, add it to your Gemfile:
# Gemfile
gem "convert_sdk"then install:
bundle installOr install it directly without Bundler:
gem install convert_sdkRequirements
| Requirement | Detail |
|---|---|
| Ruby | ≥ 3.1 |
| Supported runtimes | CRuby 3.1, 3.2, 3.3, 3.4 — and JRuby |
| Runtime dependencies | None. Stdlib only (Net::HTTP, URI, JSON, Mutex). |
The gem deliberately ships no runtime dependencies, so adding convert_sdk pulls nothing else into your bundle.
Optional: the redis gem (for RedisStore)
redis gem (for RedisStore)The default data store is an in-process MemoryStore. For multi-process fleets (Puma clusters, Sidekiq worker pools, Lambda) where sticky bucketing and goal deduplication must be shared across processes, the SDK ships a first-party ConvertSdk::Stores::RedisStore.
RedisStore needs the redis gem — but only when it builds its own client from connection options, and even then the require "redis" is lazy (it happens inside the store's constructor, never at require "convert_sdk"). The redis gem is therefore your dependency, never the SDK's:
# Gemfile — add this only if you use RedisStore with connection options
gem "redis"require "convert_sdk"
store = ConvertSdk::Stores::RedisStore.new(url: ENV.fetch("REDIS_URL"))
CONVERT_SDK = ConvertSdk.create(sdk_key: ENV.fetch("CONVERT_SDK_KEY"), store: store)If you inject an already-built client (RedisStore.new(redis: my_client)), no require "redis" happens at all — preferred for connection reuse/pooling. See Configuration Options and Persistent DataStore.
Pin a version in production
For reproducible builds, pin a specific version (gem "convert_sdk", "~> 1.0") rather than tracking the latest. Released versions are listed on the RubyGems listing and in the release history.
Verifying the integration
After adding the gem and initializing the SDK, turn on verbose logging and watch your sink. Set log_level: to ConvertSdk::LogLevel::TRACE and pass a sink: (any object responding to debug/info/warn/error, e.g. the stdlib Logger):
require "convert_sdk"
require "logger"
CONVERT_SDK = ConvertSdk.create(
sdk_key: ENV.fetch("CONVERT_SDK_KEY"),
log_level: ConvertSdk::LogLevel::TRACE,
sink: Logger.new($stdout)
)A successful integration logs the config fetch and an installed fetched config line, then fires ready. See Troubleshooting if decisions keep returning sentinels.
Next steps
- Initialization —
ConvertSdk.create, fetch vs direct-data mode, thereadyevent - Configuration Options — every config option and its default