Skip to content

Commit 2044b69

Browse files
nbarracloughclaude
andauthored
docs: refresh README to match converged Nylas SDK style (#541)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0eec01d commit 2044b69

2 files changed

Lines changed: 123 additions & 59 deletions

File tree

README.md

Lines changed: 123 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,185 @@
1-
<a href="https://www.nylas.com/">
2-
<img src="https://brand.nylas.com/assets/downloads/logo_horizontal_png/Nylas-Logo-Horizontal-Blue_.png" alt="Aimeos logo" title="Aimeos" align="right" height="60" />
3-
</a>
1+
<div align="center">
2+
<a href="https://www.nylas.com/">
3+
<img src="/diagrams/nylas-logo.png" alt="Nylas" height="80" />
4+
</a>
45

5-
# Nylas Ruby SDK
6+
<h1>Nylas Ruby SDK</h1>
67

7-
[![Gem (including prereleases)](https://img.shields.io/gem/v/nylas?include_prereleases)](https://rubygems.org/gems/nylas)
8-
[![codecov](https://codecov.io/gh/nylas/nylas-ruby/branch/main/graph/badge.svg?token=IKH0YMH4KA)](https://codecov.io/gh/nylas/nylas-ruby)
8+
<p>
9+
<strong>The official Ruby SDK for Nylas — the infrastructure that powers communications</strong>
10+
</p>
911

10-
This is the GitHub repository for the Nylas Ruby SDK. This repo is primarily for anyone who wants to make contributions to the SDK or install it from source. For documentation on how to use this SDK to access the Nylas Email, Calendar, or Contacts APIs, see the official [Ruby SDK Quickstart Guide](https://developer.nylas.com/docs/sdks/ruby/).
12+
<p>
13+
<a href="https://rubygems.org/gems/nylas"><img src="https://img.shields.io/gem/v/nylas" alt="version" /></a>
14+
<a href="https://codecov.io/gh/nylas/nylas-ruby"><img src="https://codecov.io/gh/nylas/nylas-ruby/branch/main/graph/badge.svg?token=IKH0YMH4KA" alt="code coverage" /></a>
15+
<a href="https://rubygems.org/gems/nylas"><img src="https://img.shields.io/gem/dt/nylas" alt="downloads" /></a>
16+
<a href="LICENSE.txt"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license" /></a>
17+
</p>
1118

12-
The Nylas Communications Platform provides REST APIs for [Email](https://developer.nylas.com/docs/email/), [Calendar](https://developer.nylas.com/docs/calendar/), and [Contacts](https://developer.nylas.com/docs/contacts/), and the Nylas SDK is the quickest way to build your integration using Ruby.
19+
<p>
20+
<a href="https://developer.nylas.com/docs/v3/sdks/ruby/">📖 SDK Guide</a> ·
21+
<a href="https://developer.nylas.com/docs/api/v3/">📚 API Reference</a> ·
22+
<a href="https://dashboard-v3.nylas.com/register">🚀 Sign up</a> ·
23+
<a href="https://github.com/orgs/nylas-samples/repositories?q=ruby">💡 Samples</a> ·
24+
<a href="https://forums.nylas.com">💬 Forum</a>
25+
</p>
26+
</div>
1327

14-
Here are some resources to help you get started:
28+
<br />
1529

16-
- [Sign up for the Nylas v3 Beta program to access the v3 Dashboard](https://info.nylas.com/apiv3betasignup.html?utm_source=github&utm_medium=devrel-surfaces&utm_campaign=&utm_content=ruby-sdk-upgrade)
17-
- [Nylas API v3 Quickstart Guide](https://developer.nylas.com/docs/v3-beta/v3-quickstart/)
18-
- [Nylas SDK Reference](https://nylas-ruby-sdk-reference.pages.dev/)
19-
- [Nylas API Reference](https://developer.nylas.com/docs/api/v3-beta/)
20-
- [Nylas Samples repo for code samples and example applications](https://github.com/orgs/nylas-samples/repositories?q=&type=all&language=ruby)
30+
The official Ruby SDK for [Nylas](https://developer.nylas.com/docs/v3/) — the infrastructure that powers communications. Integrate with Gmail, Microsoft, IMAP, Zoom, and 250+ email, calendar, and meeting providers in 5 minutes. Covers [Email](https://developer.nylas.com/docs/v3/email/), [Calendar](https://developer.nylas.com/docs/v3/calendar/), [Contacts](https://developer.nylas.com/docs/v3/email/contacts/), [Scheduler](https://developer.nylas.com/docs/v3/scheduler/), [Notetaker](https://developer.nylas.com/docs/v3/notetaker/), and [Agent Accounts](https://developer.nylas.com/docs/v3/agent-accounts/).
2131

22-
If you have a question about the Nylas Communications Platform, [contact Nylas Support](https://support.nylas.com/) for help.
32+
This repository is for contributors and anyone installing the SDK from source. If you just want to use the SDK in your app, head straight to the **[Ruby SDK guide](https://developer.nylas.com/docs/v3/sdks/ruby/)** on developer.nylas.com.
2333

24-
## ⚙️ Install
34+
## Get started
2535

26-
### Prerequisites
36+
1. [Sign up for a free Nylas account](https://dashboard-v3.nylas.com/register).
37+
2. Follow the [getting started guide](https://developer.nylas.com/docs/v3/getting-started/) to provision an application and create your API key.
38+
3. Bootstrap a project with the Nylas CLI:
2739

28-
- Ruby 3.0 or above.
29-
- Ruby Frameworks: `httparty` and `yajl-ruby`.
40+
```bash
41+
brew install nylas/nylas-cli/nylas
42+
nylas init
43+
```
3044

31-
### Install
45+
## ⚙️ Install
3246

33-
Add this line to your application's Gemfile:
47+
> **Requirements:** Ruby 3.0 or later.
48+
49+
Add the gem to your Gemfile:
3450

3551
```ruby
36-
gem 'nylas'
52+
gem "nylas"
3753
```
3854

39-
And then execute:
55+
Then install:
4056

4157
```bash
42-
bundle
58+
bundle install
4359
```
4460

45-
To run scripts that use the Nylas Ruby SDK, install the `nylas` gem.
61+
Or install it directly:
4662

4763
```bash
4864
gem install nylas
4965
```
5066

51-
To install the SDK from source, clone this repo and install with bundle.
67+
### Build from source
5268

5369
```bash
54-
git clone https://github.com/nylas/nylas-ruby.git && cd nylas-ruby
70+
git clone https://github.com/nylas/nylas-ruby.git
71+
cd nylas-ruby
5572
bundle install
5673
```
5774

58-
### Set up Ruby SDK for Development
75+
Run the test suite with `rspec spec`.
5976

60-
Install [RubyGems](https://rubygems.org/pages/download) if you don't already have it:
77+
## ⚡️ Usage
6178

62-
```shell
63-
gem install bundler
64-
gem update --system
65-
```
79+
Initialize the client with your API key:
6680

67-
Install the SDK from source
81+
```ruby
82+
require "nylas"
6883

69-
```shell
70-
bundle install
84+
nylas = Nylas::Client.new(
85+
api_key: "NYLAS_API_KEY"
86+
)
7187
```
7288

73-
You can run tests locally using ```rspec```:
89+
Then make a request — for example, list a grant's calendars:
7490

75-
```shell
76-
rspec spec
91+
```ruby
92+
calendars, request_id, next_cursor = nylas.calendars.list(identifier: "GRANT_ID")
7793
```
7894

79-
## ⚡️ Usage
95+
Every SDK call returns a tuple. List endpoints return `[data, request_id, next_cursor, headers]`; single-record endpoints return `[data, request_id]`. Destructure the elements you need and ignore the rest with `_`. Use `next_cursor` to paginate:
8096

81-
To use this SDK, you must first [sign up for the v3 Beta and get a free Nylas account](https://info.nylas.com/apiv3betasignup.html?utm_source=github&utm_medium=devrel-surfaces&utm_campaign=&utm_content=ruby-sdk-upgrade).
97+
```ruby
98+
cursor = nil
99+
loop do
100+
page, _request_id, cursor = nylas.calendars.list(
101+
identifier: "GRANT_ID",
102+
query_params: { page_token: cursor }
103+
)
104+
page.each { |calendar| puts calendar[:name] }
105+
break unless cursor
106+
end
107+
```
82108

83-
Then, follow the Quickstart guide to [set up your first app and get your API keys](https://developer.nylas.com/docs/v3-beta/v3-quickstart/).
109+
For step-by-step walkthroughs, see the developer guides:
84110

85-
For code examples that demonstrate how to use this SDK, take a look at our [Ruby repos in the Nylas Samples collection](https://github.com/orgs/nylas-samples/repositories?q=&type=all&language=ruby).
111+
- [Email](https://developer.nylas.com/docs/v3/email/)
112+
- [Calendar](https://developer.nylas.com/docs/v3/calendar/)
113+
- [Scheduler](https://developer.nylas.com/docs/v3/scheduler/)
114+
- [Notetaker](https://developer.nylas.com/docs/v3/notetaker/)
115+
- [Agent Accounts](https://developer.nylas.com/docs/v3/agent-accounts/)
116+
- [Notifications & webhooks](https://developer.nylas.com/docs/v3/notifications/)
86117

87-
### 🚀 Making Your First Request
118+
### Error handling
88119

89-
All of the functionality of the Nylas Communications Platform is available through the `Client` object. To access data for an account that’s connected to Nylas, create a new API client object and pass in your Nylas API key. In the following example, replace `NYLAS_API_KEY` with your Nylas API Key, and you can provide other additional configurations such as the Nylas API url and the timeout.
120+
The SDK raises typed errors you can rescue. API failures raise `Nylas::NylasApiError` (with `type`, `status_code`, `request_id`, `provider_error`, `headers`); OAuth failures raise `Nylas::NylasOAuthError`; request timeouts raise `Nylas::NylasSdkTimeoutError`.
90121

91122
```ruby
92-
require 'nylas'
123+
begin
124+
nylas.messages.find(identifier: "GRANT_ID", message_id: "MESSAGE_ID")
125+
rescue Nylas::NylasApiError => e
126+
warn "Nylas API error #{e.status_code} (#{e.type}): #{e.message}"
127+
rescue Nylas::NylasSdkTimeoutError => e
128+
warn "Request to #{e.url} timed out after #{e.timeout}s"
129+
end
130+
```
93131

94-
nylas = Nylas::Client.new(
95-
api_key: "NYLAS_API_KEY",
96-
)
132+
## 💡 Examples
133+
134+
- Local examples live in [`examples/`](examples/) (messages, events, folders, notetaker).
135+
- The [Nylas Samples org](https://github.com/orgs/nylas-samples/repositories?q=ruby) has end-to-end Ruby apps you can clone and run.
136+
137+
## 🤖 AI agents
138+
139+
[nylas/skills](https://github.com/nylas/skills) drops Nylas into Claude Code, Cursor, Codex, and other agents that support the skills format:
140+
141+
```bash
142+
npx skills add nylas/skills
143+
/plugin marketplace add nylas/skills # Claude Code
97144
```
98145

99-
Now, you can use `nylas` to access full email, calendar, and contacts functionality, for example to list all the calendars for a given account:
146+
The CLI also installs an MCP server for Claude Desktop, Claude Code, Cursor, Windsurf, or VS Code:
100147

101-
```ruby
102-
calendars, _request_ids = nylas.calendars.list(identifier: "GRANT_ID")
148+
```bash
149+
brew install nylas/nylas-cli/nylas
150+
nylas mcp install
103151
```
104152

105-
## 📚 Documentation
153+
Walkthrough: [give AI agents email access via MCP](https://cli.nylas.com/guides/give-ai-agents-email-access-via-mcp).
106154

107-
Nylas maintains a [reference guide for the Ruby SDK](https://nylas-ruby-sdk-reference.pages.dev/) to help you get familiar with the available methods and classes.
155+
## 📚 Reference
108156

109-
## ✨ Upgrading from 5.x
157+
- [Ruby SDK guide](https://developer.nylas.com/docs/v3/sdks/ruby/)
158+
- [API reference](https://developer.nylas.com/docs/api/v3/)
159+
- [Getting started](https://developer.nylas.com/docs/v3/getting-started/)
160+
- [Email](https://developer.nylas.com/docs/v3/email/) · [Calendar](https://developer.nylas.com/docs/v3/calendar/) · [Scheduler](https://developer.nylas.com/docs/v3/scheduler/) · [Notetaker](https://developer.nylas.com/docs/v3/notetaker/) · [Agent Accounts](https://developer.nylas.com/docs/v3/agent-accounts/) · [Notifications](https://developer.nylas.com/docs/v3/notifications/)
161+
- [Data residency](https://developer.nylas.com/docs/dev-guide/platform/data-residency/)
162+
- [Nylas CLI](https://cli.nylas.com)
163+
- [Forum](https://forums.nylas.com)
110164

111-
See [UPGRADE.md](UPGRADE.md) for instructions on upgrading from 5.x to 6.x.
165+
## ✨ Upgrading
112166

113-
**Note**: The Ruby SDK v6.x is not compatible with the Nylas API earlier than v3-beta. If you are using Nylas v2.7 or earlier, continue using the v5.x Nylas Ruby SDK.
167+
See [CHANGELOG.md](CHANGELOG.md) for release notes, and [UPGRADE.md](UPGRADE.md) for the 5.x → 6.x migration guide. The 6.x line targets Nylas API v3; if you're still on v2.7 or earlier, stay on the 5.x SDK.
114168

115169
## 💙 Contributing
116170

117-
Please refer to [Contributing](Contributing.md) for information about how to make contributions to this project. We welcome questions, bug reports, and pull requests.
171+
Bug reports, questions, and pull requests are welcome. See [Contributing.md](Contributing.md) for the workflow, and the [Nylas Forum](https://forums.nylas.com) for broader discussion.
172+
173+
## 🔒 Security
174+
175+
To report a security vulnerability, follow the [Nylas Vulnerability Disclosure Policy](https://www.nylas.com/security/vulnerability-disclosure-policy/). Please don't open a public GitHub issue for security reports.
176+
177+
## 🔗 Other Nylas SDKs
178+
179+
- [nylas-nodejs](https://github.com/nylas/nylas-nodejs)
180+
- [nylas-python](https://github.com/nylas/nylas-python)
181+
- [nylas-java](https://github.com/nylas/nylas-java) (Java & Kotlin)
118182

119183
## 📝 License
120184

121-
This project is licensed under the terms of the MIT license. Please refer to [LICENSE](LICENSE.txt) for the full terms.
185+
MIT — see [LICENSE.txt](LICENSE.txt).

diagrams/nylas-logo.png

24.4 KB
Loading

0 commit comments

Comments
 (0)