Courier Ruby SDK

The Courier Ruby SDK provides typed access to the Courier REST API from Ruby applications. Use it to send notifications, manage user profiles, check message status, issue JWT tokens for client-side SDKs, and more.

Installation

Add the gem to your Gemfile:

gem "trycourier", "~> 4.26.2"

Then run bundle install. Requires Ruby 3.2+.

Quick Start

require "bundler/setup"
require "courier"

courier = Courier::Client.new(
  api_key: ENV["COURIER_API_KEY"] # the default, can be omitted
)

response = courier.send_.message(
  message: {to: {user_id: "your_user_id"}, template: "your_template_id", data: {foo: "bar"}}
)

puts(response.requestId)

The client reads COURIER_API_KEY from your environment automatically.

Note the trailing underscore on send_send is reserved in Ruby.

Documentation

Full documentation: courier.com/docs/sdk-libraries/ruby