0.0
The project is in a healthy, maintained state
Server SDK for Shipeasy. Polls /sdk/flags and /sdk/experiments, evaluates gates and experiments locally, forwards exposures + metrics to /collect, and (when loaded inside Rails) auto-mounts i18n_head_tags / i18n_inline_data / i18n_script_tag / i18n_t view helpers for the Shipeasy string-manager CDN.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 13.0
~> 3.13
~> 1.71
>= 1.0.1, < 3.0
>= 0
~> 7.1
 Project Readme

shipeasy-sdk (Ruby)

Tests Gem Ruby

Server SDK for Shipeasy β€” feature flags, dynamic configs, kill switches, A/B experiments, and metric tracking, with Rails i18n view helpers. Server-key only; never embed in a browser.

πŸ“š Full documentation: https://shipeasy-ai.github.io/sdk-ruby/ β€” also browsable under docs/. This README is generated from those docs.

Source-available under the Shipeasy-SAL 1.0.

πŸ€– Using an AI agent?

This SDK ships an installable agent skill β€” a copy-paste-ready guide to Shipeasy.configure + Client.new(user), testing, experiments, error reporting, and more, with links the agent can pull for deeper docs:

  • Skill: docs/skill/SKILL.md Β· raw: https://shipeasy-ai.github.io/sdk-ruby/skill/SKILL.md
  • Install it (ships with the gem β€” no network): shipeasy-skill install β†’ .claude/skills/shipeasy-ruby/SKILL.md (or via the Shipeasy CLI: shipeasy docs skill --sdk ruby --install)

Humans: you can copy that skill straight into your own project's agent skills directory (e.g. .claude/skills/shipeasy-ruby/SKILL.md) so your coding agent always uses the correct Shipeasy patterns. Every doc page and snippet is also fetchable by URL β€” start from the manifest at https://shipeasy-ai.github.io/sdk-ruby/manifest.json.

Install

# Gemfile
gem "shipeasy-sdk"

Requires Ruby 3.0+. Per-framework setup (Rails / Sinatra / serverless) and the anon-id middleware are on the Installation page.

Quickstart β€” configure once, then Client.new(user) per request

# boot (config/initializers/shipeasy.rb)
Shipeasy.configure do |c|
  c.api_key    = ENV.fetch("SHIPEASY_SERVER_KEY")
  c.attributes = ->(u) { { "user_id" => u.id, "plan" => u.plan } }
end

# per request β€” construct once per callsite (cheap; binds the user)
flags = Shipeasy::Client.new(current_user)

flags.get_flag("new_checkout")                       # NO user arg β€” bound at construction
flags.get_config("button_color")
assignment = flags.universe("checkout").assign       # <=1 experiment; auto-logs exposure
assignment.get("label", "Buy")                       # variant ?? universe default ?? fallback
flags.track("purchase", { revenue: 49 })             # on conversion
flags.get_killswitch("payments")

Constructing Shipeasy::Client.new(user) before Shipeasy.configure raises Shipeasy::Error.

Documentation

Page What
Overview The Shipeasy.configure + Client.new(user) model.
Installation Install, frameworks (Rails / Sinatra / serverless), configure wiring.
Configuration Keys, attributes, one-shot vs poll, every option.
Feature flags get_flag, get_flag_detail, defaults.
Dynamic configs get_config, typed decode, defaults.
Kill switches get_killswitch, named switches.
Experiments universe(name).assign, Assignment#get, track.
Internationalization Rails view helpers + the SSR loader tag.
Error reporting see() structured error reporting.
Testing configure_for_testing / configure_for_offline, overrides.
OpenFeature Shipeasy::OpenFeature::Provider (OpenFeature server provider).
Advanced Anon-id middleware, private attributes, sticky bucketing, SSR.
Admin API client Optional Shipeasy::Admin::Client for administering resources (generated from the Open…

Copy-paste snippets live under docs/snippets/ (release Β· metrics Β· i18n Β· ops); an installable agent skill is at docs/skill/SKILL.md.

Testing

Use Shipeasy.configure_for_testing β€” the test-mode sibling of Shipeasy.configure. It does zero network, needs no api key, and seeds the values your code under test should see via override arguments. Then read through the ordinary Shipeasy::Client.new(user) β€” the same call your production code uses.

require "shipeasy-sdk"

Shipeasy.configure_for_testing(
  flags:       { "new_checkout" => true },
  configs:     { "billing_copy" => { "title" => "Welcome" } },
  experiments: { "checkout_button" => ["treatment", { "color" => "green" }] },
)

# construct once per callsite (cheap; binds the user)
client = Shipeasy::Client.new({ "user_id" => "u_123" })

client.get_flag("new_checkout")              # => true
client.get_config("billing_copy")            # => { "title" => "Welcome" }

# An experiment override surfaces through universe(name).assign once the loaded
# blob maps that experiment to its universe (an offline snapshot does this; a
# bare configure_for_testing has no blob). Read via the universe:
assignment = client.universe("checkout").assign
assignment.enrolled?                         # => true
assignment.group                             # => "treatment"
assignment.get("color")                      # => "green"

# track / assign exposures are no-ops in test mode β€” safe to call, send nothing
client.track("purchase", { amount: 49 })

More β€” the on-the-spot override helpers and a working example shipeasy-snapshot.json β€” on the Testing page.

License

Shipeasy-SAL 1.0 β€” source-available, non-commercial-use, permitted as a Shipeasy client. Evaluation is tested against the cross-language MurmurHash3 vectors in experiment-platform/04-evaluation.md.