-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
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.
With Bundler, add it to your Gemfile:
# Gemfile
gem "convert_sdk"then install:
bundle installOr install it directly without Bundler:
gem install convert_sdk| 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.
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.
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.
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.
-
Initialization —
ConvertSdk.create, fetch vs direct-data mode, thereadyevent - Configuration Options — every config option and its default
Copyrights © 2026 All Rights Reserved by Convert Insights, Inc.
Getting Started
Ruby SDK
- Quickstart
- Installation
- Initialization
- Configuration
- Return Types & Sentinels
- Code Examples
- Fork Safety & Runtime Recipes
- Tracking Control
Core Concepts
- Experiences & Variations
- Feature Flags
- Bucketing Algorithm
- Rule Evaluation
- Segments
- Data Management
- Event System
- API Communication
How-To Guides
- Running Experiences
- Running Features
- Tracking Conversions
- Visitor Context
- Persistent DataStore
- Troubleshooting
Contributing