Calvery SDK — Ruby
Official Ruby SDK for Calvery Vault secret manager. Ruby 3.0+. Zero runtime deps — stdlib only.
Install
gem install calvery
Or in Gemfile:
gem "calvery", "~> 0.1"
Quickstart
require "calvery"
client = Calvery::Client.new(ENV["CVSM_TOKEN"], "acme-corp")
# Single secret
db_url = client.get("DATABASE_URL")
# All secrets
all = client.get_all
puts all.keys
# Inject into ENV (skip ones already set)
injected = client.inject!(overwrite: false)
puts "Injected #{injected.size} vars"
Config
client = Calvery::Client.new(
ENV["CVSM_TOKEN"],
"acme-corp",
base_url: "https://vault.your-company.internal",
environment: "staging",
cache_ttl: 60,
max_retries: 5,
timeout: 30,
)
Error handling
begin
val = client.get("DATABASE_URL")
rescue Calvery::NotFound => e
warn "secret missing: #{e.}"
rescue Calvery::AuthError => e
warn "token invalid: #{e.}"
rescue Calvery::NetworkError => e
warn "network: #{e.}"
rescue Calvery::ServerError => e
warn "HTTP #{e.status}: #{e.}"
end
Rails
config/initializers/calvery.rb:
Rails.application.config.calvery = Calvery::Client.new(
ENV.fetch("CVSM_TOKEN"),
ENV.fetch("CVSM_TEAM"),
environment: Rails.env,
)
# Load ke ENV saat boot
Rails.application.config.calvery.inject!(overwrite: false)
License
MIT — support support@calvery.xyz, issues github.com/RenzyArmstrong/Calvery-Vault