{"id":15138237,"url":"https://github.com/kevin-rs/nylas","last_synced_at":"2025-10-25T09:01:50.652Z","repository":{"id":200203433,"uuid":"705331385","full_name":"kevin-rs/nylas","owner":"kevin-rs","description":"The non-official Rust SDK for the Nylas API v2 (WIP).","archived":false,"fork":false,"pushed_at":"2023-10-31T12:56:43.000Z","size":116,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T02:40:37.708Z","etag":null,"topics":["authentication","hacktoberfest","nylas","nylas-sdk","rocket","rust","sdk"],"latest_commit_sha":null,"homepage":"https://docs.rs/nylas","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/kevin-rs.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}},"created_at":"2023-10-15T18:08:33.000Z","updated_at":"2024-04-06T13:26:56.000Z","dependencies_parsed_at":"2023-10-16T03:50:25.690Z","dependency_job_id":"bfc726eb-2e6c-4208-bf9d-022a7dcd436c","html_url":"https://github.com/kevin-rs/nylas","commit_stats":null,"previous_names":["wiseaidev/nylas","kevin-rs/nylas"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevin-rs%2Fnylas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevin-rs%2Fnylas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevin-rs%2Fnylas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevin-rs%2Fnylas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevin-rs","download_url":"https://codeload.github.com/kevin-rs/nylas/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457787,"owners_count":20941907,"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","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":["authentication","hacktoberfest","nylas","nylas-sdk","rocket","rust","sdk"],"created_at":"2024-09-26T07:21:20.790Z","updated_at":"2025-10-25T09:01:50.593Z","avatar_url":"https://github.com/kevin-rs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nylas Rust SDK\n\n[![Rust](https://img.shields.io/badge/Rust-1.50%2B-blue.svg)](https://www.rust-lang.org)\n[![License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](LICENSE)\n\n💌 A Rust client library for the Nylas email and calendar API.\n\n## Overview\n\nThis Nylas Rust SDK is a library that provides Rust developers with easy access to the Nylas email and calendar API. Nylas is a powerful platform for building email, calendar, and contact functionality into applications.\n\n🌟 **Key Features:**\n\n- Retrieve email messages, threads, and threads.\n- Access event and calendar information.\n- Interact with folders, labels, and tags.\n- Manage accounts and account details.\n- Utilize powerful search and filter capabilities.\n- And much more!\n\n🚀 This client library empowers you to integrate the Nylas API seamlessly into your Rust applications.\n\n## Installation\n\nTo include the Nylas Rust SDK in your project, add it as a dependency in your `Cargo.toml` file:\n\n```toml\n[dependencies]\nnylas = \"0.0.7\"\ntokio = \"1.33.0\"\n```\n\nYou can find the latest version on [Crates.io](https://crates.io/crates/nylas).\n\n## Usage\n\n🔐 **Authentication**: Start by setting up authentication and obtaining an access token.\n\n```rust\nuse nylas::client::Nylas;\n\n#[tokio::main]\nasync fn main() {\n    let client_id = \"YOUR_CLIENT_ID\";\n    let client_secret = \"YOUR_CLIENT_SECRET\";\n\n    // Initialize the Nylas client with client ID and secret\n    let mut nylas = Nylas::new(client_id, client_secret, None).await.unwrap();\n\n    // Define authentication parameters\n    let redirect_uri = \"http://localhost:3000\";\n    let login_hint = Some(\"user@example.com\");\n    let state = Some(\"unique_identifier\");\n    let scopes = Some(\"email,calendar,contacts\");\n\n    // Generate an authentication URL\n    match nylas.authentication_url(redirect_uri, login_hint, state, scopes) {\n        Ok(auth_url) =\u003e println!(\"Authentication URL: {}\", auth_url),\n        Err(error) =\u003e eprintln!(\"Error: {}\", error),\n    }\n\n    // Set the access token exchanged\n    let access_token = \"YOUR_ACCESS_TOKEN\";\n    nylas = Nylas::new(client_id, client_secret, Some(access_token))\n        .await\n        .unwrap();\n}\n```\n\n📧 **Retrieve All Messages**: Fetch all messages from the Nylas API.\n\n```rust\n// ...\n\n// Call the all method to retrieve all messages\nlet messages = nylas.messages().all().await;\n\nmatch messages {\n    Ok(messages) =\u003e {\n        for message in messages {\n            // Process each message\n            println!(\"Message To: {:?}\", message.to);\n        }\n    }\n    Err(err) =\u003e {\n        // Handle the error\n        eprintln!(\"Error: {}\", err);\n    }\n}\n```\n\n🔍 **Search for Messages**: Search for messages based on a query.\n\n```rust\n// ...\n\n// Call the `search` method to search for messages\nlet query = \"user@example.com\";\nlet limit = Some(1);\nlet offset = Some(0);\nlet result = nylas.messages().search(query, limit, offset).await;\n\nmatch result {\n    Ok(messages) =\u003e {\n        for message in messages {\n            // Process each searched message\n            println!(\"Searched Message: {:?}\", message);\n        }\n    }\n    Err(err) =\u003e {\n        // Handle the error\n        eprintln!(\"Error: {}\", err);\n    }\n}\n```\n\n🔍 **Filter Messages**: Filter messages based on specified criteria with an optional view parameter.\n\n```rust\n// ...\n\n// Define filter parameters as a HashMap\nlet mut filter = HashMap::new();\nfilter.insert(\"to\", \"user@example.com\");\n\n// Call the `where_` method with filter and view parameters\nlet messages = nylas.messages().where_(Some(filter), Some(View::Expanded)).await;\n\nmatch messages {\n    Ok(messages) =\u003e {\n        for message in messages {\n            // Process each message\n            println!(\"Message ID: {}\", message.id);\n            // Access other fields as necessary\n        }\n    }\n    Err(err) =\u003e {\n        // Handle the error\n        eprintln!(\"Error: {}\", err);\n    }\n}\n```\n\n📨 **Retrieve the First Message**: Get the most recent message from the Nylas API.\n\n```rust\n// ...\n\nlet message_result = nylas.messages().first().await;\n\nmatch message_result {\n    Ok(Some(message)) =\u003e {\n        // Process the first message\n        println!(\"First Message: {:?}\", message);\n    }\n    Ok(None) =\u003e {\n        // Handle the case when there are no messages\n        println!(\"No messages found.\");\n    }\n    Err(err) =\u003e {\n        // Handle the error\n        eprintln!(\"Error: {}\", err);\n    }\n}\n```\n\n🔍 **Retrieve a Specific Message by ID**: Get a specific message by its ID.\n\n```rust\n// ...\n\nlet message_id = \"YOUR_MESSAGE_ID\";\nlet message_result = nylas.messages().get(message_id, None).await;\n\nmatch message_result {\n    Ok(Some(message)) =\u003e {\n        // Process the retrieved message\n        println!(\"Message ID: {:?}\", message.id);\n        // In expanded view mode, you can access message.headers, etc.\n    }\n    Ok(None) =\u003e {\n        // Handle the case when the message is not found\n        println!(\"Message not found.\");\n    }\n    Err(err) =\u003e {\n        // Handle the error\n        eprintln!(\"Error: {}\", err);\n    }\n}\n```\n\nExplore the [examples](examples) folder for more usage scenarios.\n\n## Documentation\n\nFor detailed documentation, including available functions and structures, refer to the [official documentation](https://docs.rs/nylas).\n\n## Contributing\n\nWe welcome contributions from the open-source community! If you'd like to contribute to the Nylas Rust Client, please read our [Contributing Guidelines](CONTRIBUTING.md).\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevin-rs%2Fnylas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevin-rs%2Fnylas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevin-rs%2Fnylas/lists"}