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.
The Nylas Communications Platform provides REST APIs for Email, Calendar, and Contacts, and the Nylas SDK is the quickest way to build your integration using Ruby.
Here are some resources to help you get started:
- # for the Nylas v3 Beta program to access the v3 Dashboard
- Nylas API v3 Quickstart Guide
- Nylas SDK Reference
- Nylas API Reference
- Nylas Samples repo for code samples and example applications
If you have a question about the Nylas Communications Platform, contact Nylas Support for help.
- Ruby 3.0 or above.
- Ruby Frameworks:
rest-client
andyajl-ruby
.
Add this line to your application's Gemfile:
gem 'nylas'
And then execute:
bundle
To run scripts that use the Nylas Ruby SDK, install the nylas
gem.
gem install nylas
To install the SDK from source, clone this repo and install with bundle.
git clone https://github.com/nylas/nylas-ruby.git && cd nylas-ruby
bundle install
Install RubyGems if you don't already have it:
gem install bundler
gem update --system
Install the SDK from source
bundle install
You can run tests locally using rspec
:
rspec spec
To use this SDK, you must first # for the v3 Beta and get a free Nylas account.
Then, follow the Quickstart guide to set up your first app and get your API keys.
For code examples that demonstrate how to use this SDK, take a look at our Ruby repos in the Nylas Samples collection.
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.
require 'nylas'
nylas = Nylas::Client.new(
api_key: "NYLAS_API_KEY",
)
Now, you can use nylas
to access full email, calendar, and contacts functionality, for example to list all the calendars for a given account:
calendars, _request_ids = nylas.calendars.list(identifier: "GRANT_ID")
Nylas maintains a reference guide for the Ruby SDK to help you get familiar with the available methods and classes.
See UPGRADE.md for instructions on upgrading from 5.x to 6.x.
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.
Please refer to Contributing for information about how to make contributions to this project. We welcome questions, bug reports, and pull requests.
This project is licensed under the terms of the MIT license. Please refer to LICENSE for the full terms.