{"id":33916692,"url":"https://github.com/fastcomments/fastcomments-ruby","last_synced_at":"2026-01-12T11:27:39.303Z","repository":{"id":324809218,"uuid":"1090549017","full_name":"FastComments/fastcomments-ruby","owner":"FastComments","description":"Official FastComments Ruby SDK (API Client \u0026 Utilities) ","archived":false,"fork":false,"pushed_at":"2025-11-21T21:36:09.000Z","size":425,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-13T12:56:11.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.fastcomments.com/guide-sdk-ruby.html","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/FastComments.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-05T20:17:29.000Z","updated_at":"2025-11-21T21:36:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/FastComments/fastcomments-ruby","commit_stats":null,"previous_names":["fastcomments/fastcomments-ruby"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FastComments/fastcomments-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastComments%2Ffastcomments-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastComments%2Ffastcomments-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastComments%2Ffastcomments-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastComments%2Ffastcomments-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FastComments","download_url":"https://codeload.github.com/FastComments/fastcomments-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastComments%2Ffastcomments-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"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":[],"created_at":"2025-12-12T07:27:26.670Z","updated_at":"2026-01-12T11:27:39.286Z","avatar_url":"https://github.com/FastComments.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastcomments\nThe FastComments Ruby SDK. You can use this to build secure and scalable backend applications that interact with FastComments, or build reactive client applications.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'fastcomments'\n```\n\nAnd then execute:\n\n```bash\nbundle install\n```\n\nOr install it yourself as:\n\n```bash\ngem install fastcomments\n```\n\n### Library Contents\n\nThis library contains the generated API client and the SSO utilities to make working with the API easier.\n\n- [API Client Library Docs](./client/README.md)\n\n### Public vs Secured APIs\n\nFor the API client, there are two classes, `DefaultApi` and `PublicApi`. The `DefaultApi` contains methods that require your API key, and `PublicApi` contains api calls\nthat can be made directly from a browser/mobile device/etc without authentication.\n\n## Quick Start\n\n### Using Authenticated APIs (DefaultApi)\n\n**Important:** You must set your API key on the ApiClient before making authenticated requests. If you don't, requests will fail with a 401 error.\n\n```ruby\nrequire 'fastcomments'\n\n# Create and configure the API client\nconfig = FastCommentsClient::Configuration.new\napi_client = FastCommentsClient::ApiClient.new(config)\n\n# REQUIRED: Set your API key (get this from your FastComments dashboard)\nconfig.api_key['x-api-key'] = 'YOUR_API_KEY_HERE'\n\n# Create the API instance with the configured client\napi = FastCommentsClient::DefaultApi.new(api_client)\n\n# Now you can make authenticated API calls\nbegin\n  # Example: Add an SSO user\n  user_data = {\n    id: 'user-123',\n    email: 'user@example.com',\n    displayName: 'John Doe'\n  }\n\n  response = api.add_sso_user('YOUR_TENANT_ID', user_data)\n  puts \"User created: #{response}\"\n\nrescue FastCommentsClient::ApiError =\u003e e\n  puts \"Error: #{e.response_body}\"\n  # Common errors:\n  # - 401: API key is missing or invalid\n  # - 400: Request validation failed\nend\n```\n\n### Using Public APIs (PublicApi)\n\nPublic endpoints don't require authentication:\n\n```ruby\nrequire 'fastcomments'\n\npublic_api = FastCommentsClient::PublicApi.new\n\nbegin\n  response = public_api.get_comments_public(\n    tenant_id: 'YOUR_TENANT_ID',\n    url_id: 'page-url-id'\n  )\n  puts response\nrescue FastCommentsClient::ApiError =\u003e e\n  puts e.message\nend\n```\n\n### Common Issues\n\n1. **401 \"missing-api-key\" error**: Make sure you set `config.api_key['x-api-key'] = 'YOUR_KEY'` before creating the DefaultApi instance.\n2. **Wrong API class**: Use `DefaultApi` for server-side authenticated requests, `PublicApi` for client-side/public requests.\n3. **Null API key**: The SDK will silently skip authentication if the API key is null, leading to 401 errors.\n\n## Notes\n\n### Broadcast Ids\n\nYou'll see you're supposed to pass a `broadcastId` in some API calls. When you receive events, you'll get this ID back, so you know to ignore the event if you plan to optimistically apply changes on the client\n(which you'll probably want to do since it offers the best experience). Pass a UUID here. The ID should be unique enough to not occur twice in a browser session.\n\n### SSO (Single Sign-On)\n\nFor SSO examples, see below.\n\n## SSO Usage\n\n### Simple SSO\n\n```ruby\nrequire 'fastcomments'\n\n# Create Simple SSO token\nuser = FastComments::SSO::SimpleSSOUserData.new(\n  user_id: 'user-123',\n  email: 'user@example.com',\n  avatar: 'https://example.com/avatar.jpg'\n)\n\nsso = FastComments::SSO::FastCommentsSSO.new_simple(user)\ntoken = sso.create_token\n\nputs \"SSO Token: #{token}\"\n\n# Use the SSO token to make an authenticated API call\nconfig = FastCommentsClient::Configuration.new\napi_client = FastCommentsClient::ApiClient.new(config)\npublic_api = FastCommentsClient::PublicApi.new(api_client)\n\nresponse = public_api.get_comments_public(\n  tenant_id: 'your-tenant-id',\n  url_id: 'your-page-url-id',\n  sso: token\n)\n\nputs \"Status: #{response}\"\n```\n\n### Secure SSO\n\n```ruby\nrequire 'fastcomments'\n\n# Create Secure SSO token\nuser = FastComments::SSO::SecureSSOUserData.new(\n  user_id: 'user-123',\n  email: 'user@example.com',\n  username: 'johndoe',\n  avatar: 'https://example.com/avatar.jpg'\n)\n\napi_key = 'your-api-key'\nsso = FastComments::SSO::FastCommentsSSO.new_secure(api_key, user)\ntoken = sso.create_token\n\nputs \"Secure SSO Token: #{token}\"\n\n# Use the SSO token to make an authenticated API call\nconfig = FastCommentsClient::Configuration.new\napi_client = FastCommentsClient::ApiClient.new(config)\npublic_api = FastCommentsClient::PublicApi.new(api_client)\n\nresponse = public_api.get_comments_public(\n  tenant_id: 'your-tenant-id',\n  url_id: 'your-page-url-id',\n  sso: token\n)\n\nputs \"Status: #{response}\"\n```\n\n## Testing\n\nSet the required environment variables:\n\n```bash\nexport FASTCOMMENTS_API_KEY=\"your-api-key\"\nexport FASTCOMMENTS_TENANT_ID=\"your-tenant-id\"\n```\n\nRun the tests:\n\n```bash\nbundle exec rspec\n```\n\n## Development\n\nTo update the generated client from the OpenAPI spec:\n\n```bash\n./update.sh\n```\n\nThis will download the latest OpenAPI spec from a running FastComments server (or use a local copy) and regenerate the client code.\n\n## License\n\nMIT License - see LICENSE file for details\n\n## Support\n\nFor support, please visit https://fastcomments.com/auth/my-account/help or email support@fastcomments.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastcomments%2Ffastcomments-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastcomments%2Ffastcomments-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastcomments%2Ffastcomments-ruby/lists"}