Skip to content

nylas/nylas-ruby

Repository files navigation

Aimeos logo

Nylas Ruby SDK

Gem (including prereleases) codecov

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:

If you have a question about the Nylas Communications Platform, contact Nylas Support for help.

⚙️ Install

Prerequisites

  • Ruby 3.0 or above.
  • Ruby Frameworks: rest-client and yajl-ruby.

Install

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

Set up Ruby SDK for Development

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

⚡️ Usage

To use this SDK, you must first sign up 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.

🚀 Making Your First Request

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")

📚 Documentation

Nylas maintains a reference guide for the Ruby SDK to help you get familiar with the available methods and classes.

✨ Upgrading from 5.x

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.

💙 Contributing

Please refer to Contributing for information about how to make contributions to this project. We welcome questions, bug reports, and pull requests.

📝 License

This project is licensed under the terms of the MIT license. Please refer to LICENSE for the full terms.