{"id":33344486,"url":"https://github.com/fastcomments/fastcomments-rust","last_synced_at":"2026-01-17T16:30:17.823Z","repository":{"id":322486230,"uuid":"946800639","full_name":"FastComments/fastcomments-rust","owner":"FastComments","description":"Official FastComments Rust SDK (Typed API Client \u0026 Utilities)","archived":false,"fork":false,"pushed_at":"2025-11-04T18:17:25.000Z","size":9991,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-04T19:16:26.339Z","etag":null,"topics":["commenting","commenting-system","rust"],"latest_commit_sha":null,"homepage":"https://docs.fastcomments.com/guide-sdk-rust.html","language":"Rust","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-03-11T17:37:45.000Z","updated_at":"2025-11-04T18:04:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/FastComments/fastcomments-rust","commit_stats":null,"previous_names":["fastcomments/fastcomments-rust"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/FastComments/fastcomments-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastComments%2Ffastcomments-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastComments%2Ffastcomments-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastComments%2Ffastcomments-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastComments%2Ffastcomments-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FastComments","download_url":"https://codeload.github.com/FastComments/fastcomments-rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastComments%2Ffastcomments-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285710892,"owners_count":27218827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-21T02:00:06.175Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["commenting","commenting-system","rust"],"created_at":"2025-11-22T00:00:21.631Z","updated_at":"2025-11-22T00:00:24.467Z","avatar_url":"https://github.com/FastComments.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastComments Rust SDK\n\nThe official Rust SDK for FastComments, a fast and developer-friendly commenting platform. This SDK provides typed API clients and utilities for integrating FastComments into your Rust applications.\n\n## Installation\n\n```bash\ncargo add fastcomments-sdk\n```\n\nThe SDK requires Rust 2021 edition or later.\n\n## Library Contents\n\nThe FastComments Rust SDK consists of several modules:\n\n- **Client Module** - Auto-generated API client for FastComments REST APIs\n  - Complete type definitions for all API models\n  - Both authenticated (`DefaultApi`) and public (`PublicApi`) endpoints\n  - Full async/await support with tokio\n  - See [client/README.md](client/README.md) for detailed API documentation\n\n- **SSO Module** - Server-side Single Sign-On utilities\n  - Secure token generation for user authentication\n  - Support for both simple and secure SSO modes\n  - HMAC-SHA256 based token signing\n\n- **Core Types** - Shared type definitions and utilities\n  - Comment models and metadata structures\n  - User and tenant configurations\n  - Helper functions for common operations\n\n## Quick Start\n\n### Using the Public API\n\n```rust\nuse fastcomments_sdk::client::apis::configuration::Configuration;\nuse fastcomments_sdk::client::apis::public_api;\n\n#[tokio::main]\nasync fn main() {\n    // Create API configuration\n    let config = Configuration::new();\n\n    // Fetch comments for a page\n    let result = public_api::get_comments_public(\n        \u0026config,\n        public_api::GetCommentsPublicParams {\n            tenant_id: \"your-tenant-id\".to_string(),\n            urlid: Some(\"page-url-id\".to_string()),\n            url: None,\n            count_only: None,\n            skip: None,\n            limit: None,\n            sort_dir: None,\n            page: None,\n            sso_hash: None,\n            simple_sso_hash: None,\n            has_no_comment: None,\n            has_comment: None,\n            comment_id_filter: None,\n            child_ids: None,\n            start_date_time: None,\n            starts_with: None,\n        },\n    )\n    .await;\n\n    match result {\n        Ok(response) =\u003e {\n            println!(\"Found {} comments\", response.comments.len());\n            for comment in response.comments {\n                println!(\"Comment: {:?}\", comment);\n            }\n        }\n        Err(e) =\u003e eprintln!(\"Error fetching comments: {:?}\", e),\n    }\n}\n```\n\n### Using the Authenticated API\n\n```rust\nuse fastcomments_sdk::client::apis::configuration::{ApiKey, Configuration};\nuse fastcomments_sdk::client::apis::default_api;\n\n#[tokio::main]\nasync fn main() {\n    // Create configuration with API key\n    let mut config = Configuration::new();\n    config.api_key = Some(ApiKey {\n        prefix: None,\n        key: \"your-api-key\".to_string(),\n    });\n\n    // Fetch comments using authenticated API\n    let result = default_api::get_comments(\n        \u0026config,\n        default_api::GetCommentsParams {\n            tenant_id: \"your-tenant-id\".to_string(),\n            skip: None,\n            limit: None,\n            sort_dir: None,\n            urlid: Some(\"page-url-id\".to_string()),\n            url: None,\n            is_spam: None,\n            user_id: None,\n            all_comments: None,\n            for_moderation: None,\n            parent_id: None,\n            is_flagged: None,\n            is_flagged_tag: None,\n            is_by_verified: None,\n            is_pinned: None,\n            asc: None,\n            include_imported: None,\n            origin: None,\n            tags: None,\n        },\n    )\n    .await;\n\n    match result {\n        Ok(response) =\u003e {\n            println!(\"Total comments: {}\", response.count);\n            for comment in response.comments {\n                println!(\"Comment ID: {}, Text: {}\", comment.id, comment.comment);\n            }\n        }\n        Err(e) =\u003e eprintln!(\"Error: {:?}\", e),\n    }\n}\n```\n\n### Using SSO for Authentication\n\n```rust\nuse fastcomments_sdk::sso::{\n    fastcomments_sso::FastCommentsSSO,\n    secure_sso_user_data::SecureSSOUserData,\n};\n\nfn main() {\n    let api_key = \"your-api-key\".to_string();\n\n    // Create secure SSO user data (server-side only!)\n    let user_data = SecureSSOUserData::new(\n        \"user-123\".to_string(),           // User ID\n        \"user@example.com\".to_string(),   // Email\n        \"John Doe\".to_string(),            // Username\n        \"https://example.com/avatar.jpg\".to_string(), // Avatar URL\n    );\n\n    // Generate SSO token\n    let sso = FastCommentsSSO::new_secure(api_key, \u0026user_data).unwrap();\n    let token = sso.create_token().unwrap();\n\n    println!(\"SSO Token: {}\", token);\n    // Pass this token to your frontend for authentication\n}\n```\n\n## Common Issues\n\n### 401 Unauthorized Errors\n\nIf you're getting 401 errors when using the authenticated API:\n\n1. **Check your API key**: Ensure you're using the correct API key from your FastComments dashboard\n2. **Verify the tenant ID**: Make sure the tenant ID matches your account\n3. **API key format**: The API key should be passed in the Configuration:\n\n```rust\nlet mut config = Configuration::new();\nconfig.api_key = Some(ApiKey {\n    prefix: None,\n    key: \"YOUR_API_KEY\".to_string(),\n});\n```\n\n### SSO Token Issues\n\nIf SSO tokens aren't working:\n\n1. **Use secure mode for production**: Always use `FastCommentsSSO::new_secure()` with your API key for production\n2. **Server-side only**: Generate SSO tokens on your server, never expose your API key to clients\n3. **Check user data**: Ensure all required fields (id, email, username) are provided\n\n### Async Runtime Errors\n\nThe SDK uses tokio for async operations. Make sure to:\n\n1. Add tokio to your dependencies:\n```toml\n[dependencies]\ntokio = { version = \"1\", features = [\"full\"] }\n```\n\n2. Use the tokio runtime:\n```rust\n#[tokio::main]\nasync fn main() {\n    // Your async code here\n}\n```\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## Support\n\nFor issues, questions, or feature requests:\n\n- GitHub Issues: [https://github.com/fastcomments/fastcomments-rust](https://github.com/fastcomments/fastcomments-rust)\n- Documentation: [https://docs.fastcomments.com](https://docs.fastcomments.com)\n- Support: support@fastcomments.com\n\n## License\n\nMIT - See [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastcomments%2Ffastcomments-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastcomments%2Ffastcomments-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastcomments%2Ffastcomments-rust/lists"}