{"id":13878544,"url":"https://github.com/workos/workos-ruby","last_synced_at":"2026-04-27T23:00:42.055Z","repository":{"id":37957791,"uuid":"226950273","full_name":"workos/workos-ruby","owner":"workos","description":"Official Ruby SDK for interacting with the WorkOS API ","archived":false,"fork":false,"pushed_at":"2026-04-27T21:16:40.000Z","size":1973,"stargazers_count":38,"open_issues_count":0,"forks_count":34,"subscribers_count":18,"default_branch":"main","last_synced_at":"2026-04-27T22:23:31.151Z","etag":null,"topics":["adfs","audit-logs","azure-active-directory","directory-sync","gsuite-saml-apps","okta","ruby-sdk","saml","scim","sso","sso-authentication"],"latest_commit_sha":null,"homepage":"https://workos.com/docs/sdk/ruby","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/workos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-12-09T19:27:13.000Z","updated_at":"2026-04-27T21:16:30.000Z","dependencies_parsed_at":"2025-12-06T09:04:22.086Z","dependency_job_id":null,"html_url":"https://github.com/workos/workos-ruby","commit_stats":{"total_commits":166,"total_committers":34,"mean_commits":4.882352941176471,"dds":0.6566265060240963,"last_synced_commit":"4d6eb31b7b083e2c210e01a80c5ccd9c954c8049"},"previous_names":["workos-inc/workos-ruby"],"tags_count":116,"template":false,"template_full_name":null,"purl":"pkg:github/workos/workos-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workos%2Fworkos-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workos%2Fworkos-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workos%2Fworkos-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workos%2Fworkos-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workos","download_url":"https://codeload.github.com/workos/workos-ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workos%2Fworkos-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32358509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["adfs","audit-logs","azure-active-directory","directory-sync","gsuite-saml-apps","okta","ruby-sdk","saml","scim","sso","sso-authentication"],"created_at":"2024-08-06T08:01:52.690Z","updated_at":"2026-04-27T23:00:42.050Z","avatar_url":"https://github.com/workos.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# WorkOS Ruby Library\n\nThe WorkOS Ruby SDK provides convenient access to the WorkOS API from applications written in Ruby.\n\n## Documentation\n\n- [Ruby SDK documentation](https://docs.workos.com/sdk/ruby)\n- [API reference](https://workos.com/docs/reference/client-libraries)\n\n## Installation\n\nInstall the package with:\n\n```sh\ngem install workos\n```\n\nIf you're using Bundler to manage your application's gems, add the WorkOS gem to your Gemfile:\n\n```ruby\nsource \"https://rubygems.org\"\n\ngem \"workos\"\n```\n\n## Configuration\n\nTo use the library, provide your WorkOS API key as `WORKOS_API_KEY` and, for AuthKit and SSO flows, your client ID as `WORKOS_CLIENT_ID`:\n\n```sh\nWORKOS_API_KEY=sk_test_123 WORKOS_CLIENT_ID=client_123 ruby app.rb\n```\n\nOr configure the SDK in an initializer:\n\n```ruby\n# /config/initializers/workos.rb\n\nrequire \"workos\"\n\nWorkOS.configure do |config|\n  config.api_key = ENV.fetch(\"WORKOS_API_KEY\")\n  config.client_id = ENV[\"WORKOS_CLIENT_ID\"]\n  config.timeout = 120\n  config.logger = Logger.new($stdout)\n  config.log_level = :info\nend\n\nclient = WorkOS.client\n```\n\n## Client patterns\n\n### Singleton (recommended for most apps)\n\n```ruby\nWorkOS.configure do |config|\n  config.api_key = ENV.fetch(\"WORKOS_API_KEY\")\n  config.client_id = ENV[\"WORKOS_CLIENT_ID\"]\nend\n\nWorkOS.client.organizations.list_organizations\n```\n\n### Multi-tenant (one client per API key)\n\n```ruby\ntenant_a = WorkOS::Client.new(api_key: \"sk_tenant_a\", client_id: \"client_a\")\ntenant_b = WorkOS::Client.new(api_key: \"sk_tenant_b\", client_id: \"client_b\")\n\ntenant_a.organizations.list_organizations\ntenant_b.organizations.list_organizations\n```\n\n### Public / PKCE (browser, mobile, CLI)\n\n```ruby\npublic_client = WorkOS::PublicClient.create(client_id: \"client_123\")\nurl, verifier, state = public_client.user_management.get_authorization_url_with_pkce(\n  redirect_uri: \"https://example.com/callback\"\n)\n```\n\n### Fork safety (Puma / Unicorn)\n\nThe SDK caches persistent connections per fiber. After forking, call\n`WorkOS.reset_client` (or `client.shutdown`) to close inherited sockets:\n\n```ruby\n# config/puma.rb\non_worker_boot { WorkOS.reset_client }\n```\n\n## Per-request options\n\nEvery API call accepts `request_options:` for per-call overrides:\n\n```ruby\norganization = WorkOS.client.organizations.get_organization(\n  id: \"org_123\",\n  request_options: {\n    timeout: 10,\n    extra_headers: {\"X-Request-Source\" =\u003e \"admin\"},\n    idempotency_key: \"org-create-123\"\n  }\n)\n```\n\n`Idempotency-Key` is only sent when you provide `request_options[:idempotency_key]`, or when the SDK retries a mutating request after a transient failure.\n\n## Usage Examples\n\n### List organizations\n\n```ruby\norganizations = WorkOS.client.organizations.list_organizations(limit: 10)\n\norganizations.data.each do |organization|\n  puts \"#{organization.id}: #{organization.name}\"\nend\n```\n\n### Get an organization\n\n```ruby\norganization = WorkOS.client.organizations.get_organization(id: \"org_123\")\nputs organization.name\n```\n\n### Create a user\n\n```ruby\nuser = WorkOS.client.user_management.create_user(\n  email: \"marceline@example.com\",\n  first_name: \"Marceline\",\n  last_name: \"Abadeer\"\n)\n\nputs user.id\n```\n\n### Verify a webhook\n\n```ruby\npayload = request.body.read\nsignature = request.env.fetch(\"HTTP_WORKOS_SIGNATURE\")\nsecret = ENV.fetch(\"WORKOS_WEBHOOK_SECRET\")\n\nevent = WorkOS.client.webhooks.construct_event(\n  payload: payload,\n  sig_header: signature,\n  secret: secret\n)\n\nputs event.event\n```\n\n## Pagination\n\nList endpoints return `WorkOS::Types::ListStruct`, which supports inspecting pagination metadata or iterating through every record automatically.\n\n```ruby\nusers = WorkOS.client.user_management.list_users(limit: 100)\n\nusers.auto_paging_each do |user|\n  puts user.email\nend\n```\n\nYou can also iterate page by page:\n\n```ruby\nusers.each_page do |page|\n  puts page.list_metadata\nend\n```\n\n## Error Handling\n\nThe SDK raises typed errors for API and transport failures.\n\n```ruby\nbegin\n  WorkOS.client.organizations.get_organization(id: \"org_123\")\nrescue WorkOS::APIError =\u003e e\n  warn \"#{e.class}: #{e.message}\"\n  warn \"status=#{e.http_status} request_id=#{e.request_id} code=#{e.code}\"\nend\n```\n\n## SDK Versioning\n\nFor our SDKs WorkOS follows a Semantic Versioning ([SemVer](https://semver.org/)) process where all releases will have a version X.Y.Z (like 1.0.0) pattern wherein Z would be a bug fix (e.g., 1.0.1), Y would be a minor release (1.1.0) and X would be a major release (2.0.0). We permit any breaking changes to only be released in major versions and strongly recommend reading changelogs before making any major version upgrades.\n\n## Beta Releases\n\nWorkOS has features in Beta that can be accessed via Beta releases. We would love for you to try these\nand share feedback with us before these features reach general availability (GA). To install a Beta version,\nplease follow the [installation steps](#installation) above using the Beta release version.\n\n\u003e Note: there can be breaking changes between Beta versions. Therefore, we recommend pinning the package version to a\n\u003e specific version. This way you can install the same version each time without breaking changes unless you are\n\u003e intentionally looking for the latest Beta version.\n\nWe highly recommend keeping an eye on when the Beta feature you are interested in goes from Beta to stable so that you\ncan move to using the stable version.\n\n## More Information\n\n- [Ruby SDK documentation](https://docs.workos.com/sdk/ruby)\n- [Single Sign-On Guide](https://workos.com/docs/sso/guide)\n- [Directory Sync Guide](https://workos.com/docs/directory-sync/guide)\n- [Admin Portal Guide](https://workos.com/docs/admin-portal/guide)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkos%2Fworkos-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkos%2Fworkos-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkos%2Fworkos-ruby/lists"}