0.0
The project is in a healthy, maintained state
Typed-ish Ruby SDK for the LicenseKit licensing API with management, runtime, and system clients plus Ed25519 verification helpers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 5.25

Runtime

~> 1.3.0
 Project Readme

licensekit-ruby

First-party Ruby SDK for licensekit.dev.

It provides Management, Runtime, and System clients for the LicenseKit licensing API, plus least-privilege scope metadata and Ed25519 runtime-signature verification helpers for activation, validation, metering, and offline-aware license flows.

Why use it

  • LicenseKit::ManagementClient, LicenseKit::RuntimeClient, and LicenseKit::SystemClient
  • Runtime signature verification backed by ed25519
  • Least-privilege scope discovery derived from the OpenAPI contract
  • Hosted and self-hosted support through a configurable base_url

Links:

Install

gem install licensekit-ruby

Quick Start

require "licensekit"

base_url = "https://api.licensekit.dev"

system = LicenseKit::SystemClient.new(base_url: base_url)
health = system.health
puts health["data"]["status"]

management = LicenseKit::ManagementClient.new(
  base_url: base_url,
  token: "lkm_..."
)

product = management.create_product(
  body: {
    "name" => "Example App",
    "code" => "example-app"
  }
)

runtime = LicenseKit::RuntimeClient.new(
  base_url: base_url,
  license_key: "lsk_..."
)

result = runtime.validate_license(
  body: {
    "fingerprint" => "host-123"
  }
)

public_keys = system.list_public_keys
verified = LicenseKit.verify_runtime_result(
  result,
  LicenseKit::PublicKeyStore.new(public_keys["data"])
)

puts [product["data"]["id"], verified.ok].join(" ")

Package Shape

  • LicenseKit::ManagementClient Uses Authorization: Bearer <token> for /api/v1/... management operations.
  • LicenseKit::RuntimeClient Uses Authorization: License <license-key> for /api/v1/license/... runtime operations.
  • LicenseKit::SystemClient Unauthenticated access to /health, /healthz, /readyz, /metrics, and /api/v1/system/public-keys.

Hosted deployments should prefer /health for liveness checks behind api.licensekit.dev. /healthz remains available for local and self-hosted compatibility.

Scope Metadata

required = LicenseKit.get_required_scopes("createProduct")
allowed = LicenseKit.has_required_scopes("createProduct", ["product:write"])

Raw Response Access

Each client exposes a raw companion for callers that need status codes and headers.

system = LicenseKit::SystemClient.new(base_url: "https://api.licensekit.dev")
ready = system.raw.readyz

puts [ready.status, ready.data["data"]["status"]].join(" ")

Development

bundle install --path vendor/bundle
ruby scripts/generate_from_openapi.rb
bundle exec ruby -Ilib:test test/test_client.rb
bundle exec ruby -Ilib:test test/test_scopes.rb
bundle exec ruby -Ilib:test test/test_verification.rb
gem build licensekit-ruby.gemspec

Generation uses the checked-in OpenAPI snapshot at openapi/openapi.yaml.