Sdks
Ruby SDK
Official Misar.Dev SDK for Ruby — build, deploy, and manage apps via api.misar.io/dev.
The official Misar.Dev client SDK for Ruby.
Installation
Add to your Gemfile:
gem "misar_dev"
Then run bundle install, or install directly:
gem install misar_devRequires Ruby >= 2.6 and depends on faraday >= 2.0.
Quick start
require "misar_dev"
client = MisarDev.new(api_key: "mdk_your_api_key")
projects = client.projects_list
puts projects
Optional keyword arguments override the base URL, retry count, and timeout:
client = MisarDev.new(
api_key: "mdk_your_api_key",
base_url: "https://api.misar.io/dev",
max_retries: 3,
timeout: 30.0
)
Configuration
Base URL https://api.misar.io/dev; auth Authorization: Bearer <key> (set as a default Faraday header). Retries (default 3) apply to 429, 500, 502, 503, 504 with exponential backoff (base 0.5 s). Default timeout 30 s. Every method returns a parsed Hash.
Resources
This Ruby port (v1.0.0) implements a subset of the full Misar.Dev API:
client.projects_list(params = {}) # GET /projects
client.projects_create(params) # POST /projects
client.api_keys_list # GET /api-keys
client.usage_get(params = {}) # GET /usage
client.chat_complete(params) # POST /chat
client.templates_list # GET /templates
projects—projects_list,projects_createapiKeys—api_keys_listusage—usage_getchat—chat_completetemplates—templates_list
Error handling
The SDK raises two error classes from the MisarDev module:
MisarDev::ApiError— raised on any non-200 response. Exposes#statusand#error_type(defaults toapi_error).MisarDev::NetworkError— subclass ofApiErrorwith status0and error typenetwork_error; raised when retries are exhausted on a connection or timeout failure.
begin
projects = client.projects_list
rescue MisarDev::NetworkError => e
warn "Network error: #{e.message}"
rescue MisarDev::ApiError => e
warn "API error #{e.status} (#{e.error_type}): #{e.message}"
end