Releases: nylas/nylas-ruby
v6.2.0
v6.1.1
v6.1.0
v6.0.3
v6.0.2
v6.0.1
v6.0.0
The Nylas Ruby SDK v6.0.0 is out of beta now Generally Available! This SDK sees a number of changes, including breaking changes, and more importantly brings full support of the new Nylas API v3.
Changelog
Breaking changes
- Ruby SDK v6 supports the Nylas API v3 exclusively, dropping support for any endpoints that are not available in v3. See API v3 Features and Changes for more information.
- Officially support minimum Ruby v3
- Removed all models and typing from the SDK.
Added
- Created error classes for the different API errors as well as SDK-specific errors
- Added a configurable timeout for outgoing calls to the API.
Updated
- Rewrote the majority of SDK to be more modular and efficient.
Removed
- Local Webhook development support is removed due to incompatibility with the new API version.
Docs and References
Please refer to the README.md for a quick description and getting started guide with the new SDK. Furthermore, we have an UPGRADE.md for instructions on upgrading from v5.x to v6.x, as well as a reference guide for the Ruby SDK.
v5.17.0
This latest release of the Nylas Ruby SDK brings a few new additions.
Release Notes
Added
- Added support for verifying webhook signatures (#413)
- Added
event.updated_at
(#410) - Allow native authentication to return the full response like the
exchange_code_for_token
(#411)
Usage
Verifying webhook signatures
require 'sinatra'
require 'nylas'
require 'json'
set :port, 9000
NYLAS_CLIENT_SECRET = ENV['NYLAS_CLIENT_SECRET']
post '/' do
content_type :json
x_nylas_signature = request.env['HTTP_X_NYLAS_SIGNATURE']
raw_body = request.body.read
unless Nylas::Webhook::verify_webhook_signature(x_nylas_signature, raw_body, NYLAS_CLIENT_SECRET)
status 403
return { error: 'Invalid signature' }.to_json
end
body = JSON.parse(raw_body)
puts "Webhook event received: #{JSON.pretty_generate(body)}"
status 200
{ success: true }.to_json
end
run Sinatra::Application.run!
New Contributors π
v5.16.0
This latest release of the Nylas Ruby SDK brings some additions.
Release Notes
Added
- Added the missing
provider_id
attribute toLabel
(#404) - Add
organizer_email
andorganizer_name
toEvent
(#409) - Added missing job status webhook triggers (#403)
Fixed
- Fix
MESSAGE_LINK_CLICKED
trigger (#403)
New Contributors π
- @VadimLeader made their first contribution in #404
v5.15.0
This release of the Nylas Ruby SDK includes the release of local webhook development support built directly into the SDK. When implementing this feature in your app, the SDK will create a tunnel connection to a websocket server and registers it as a webhook callback to your Nylas account. See below for a usage example.
Release Notes
Added
- Add local webhook testing support (#399)
- Add
tzinfo
,faye-websocket
,eventmachine
as runtime dependencies (#401)
Usage
Webhook Tunnel
During the setup process you can pass in methods to override the websocket client's callback methods. The most important method is the on_message
method which returns a parsed delta event from the webhook server.
nylas = Nylas::API.new(
app_id: CLIENT_ID,
app_secret: CLIENT_SECRET
)
# Define the callback for the on_message event
def on_message(delta)
if delta.type == Nylas::WebhookTrigger::MESSAGE_UPDATED
p [:delta, delta]
end
end
# Config that sets the region, triggers, and callbacks
config = {
"region": "us",
"triggers": [WebhookTrigger::MESSAGE_UPDATED],
"on_message": method(:on_message)
}
# Create, register, and open the webhook tunnel for testing
Nylas::Tunnel::open_webhook_tunnel(nylas, config)