{"id":20535058,"url":"https://github.com/jhuntdev/blest-ruby","last_synced_at":"2026-02-03T07:33:04.667Z","repository":{"id":179998500,"uuid":"663679545","full_name":"jhuntdev/blest-ruby","owner":"jhuntdev","description":"The Ruby reference implementation of BLEST (Batch-able, Lightweight, Encrypted State Transfer), an improved communication protocol for web APIs which leverages JSON, supports request batching by default, and provides a modern alternative to REST.","archived":false,"fork":false,"pushed_at":"2024-12-29T17:51:30.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T22:08:35.111Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhuntdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-07T21:27:51.000Z","updated_at":"2024-12-29T17:51:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a51ffd5-fa88-4968-88ef-abb3a5b6c4a9","html_url":"https://github.com/jhuntdev/blest-ruby","commit_stats":null,"previous_names":["jhuntdev/blest-ruby"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jhuntdev/blest-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhuntdev","download_url":"https://codeload.github.com/jhuntdev/blest-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fblest-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29037521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T06:39:36.383Z","status":"ssl_error","status_checked_at":"2026-02-03T06:39:32.787Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T00:29:09.625Z","updated_at":"2026-02-03T07:33:04.641Z","avatar_url":"https://github.com/jhuntdev.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BLEST Ruby\n\nThe Ruby reference implementation of BLEST (Batch-able, Lightweight, Encrypted State Transfer), an improved communication protocol for web APIs which leverages JSON, supports request batching by default, and provides a modern alternative to REST.\n\nTo learn more about BLEST, please visit the website: https://blest.jhunt.dev\n\nFor a front-end implementation in React, please visit https://github.com/jhuntdev/blest-react\n\n## Features\n\n- Built on JSON - Reduce parsing time and overhead\n- Request Batching - Save bandwidth and reduce load times\n- Compact Payloads - Save even more bandwidth\n- Single Endpoint - Reduce complexity and facilitate introspection\n- Fully Encrypted - Improve data privacy\n\n## Installation\n\nInstall BLEST Ruby from Rubygems.\n\n```bash\ngem install blest\n```\n\n## Usage\n\n### Router\n\nThe following example uses Sinatra, but you can find examples with other frameworks [here](examples).\n\n```ruby\nrequire 'sinatra'\nrequire 'json'\nrequire 'blest'\n\n# Instantiate the Router\nrouter = Router.new(timeout: 1000)\n\n# Create some middleware (optional)\nrouter.before do |body, context|\n  context['user'] = {\n    # user info for example\n  }\nend\n\n# Create a route controller\nrouter.route('greet') do |body, context|\n  {\n    greeting: \"Hi, #{body['name']}!\"\n  }\nend\n\n# Handle BLEST requests\npost '/' do\n  json_body = JSON.parse(request.body.read)\n  headers = request.env.select { |k, _| k.start_with?('HTTP_') }\n  result, error = router.handle.call(json_body, { 'httpHeaders' =\u003e headers })\n  content_type :json\n  if error\n    raise Sinatra::Error.new(error.status || 500, error)\n  else\n    result\n  end\nend\n```\n\n### HttpClient\n\n```ruby\nrequire 'blest'\n\n# Create a client\nclient = HttpClient.new('http://localhost:8080', max_batch_size = 25, buffer_delay = 10, http_headers = {\n  'Authorization': 'Bearer token'\n})\n\n# Send a request\nbegin\n  result = client.request('greet', { 'name': 'Steve' }).value\n  # Do something with the result\nrescue =\u003e error\n  # Do something in case of error\nend\n```\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhuntdev%2Fblest-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhuntdev%2Fblest-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhuntdev%2Fblest-ruby/lists"}