Search…
Getting started with Ruby
The source code of the Ruby SDK is hosted here: https://github.com/clerkinc/clerk-sdk-ruby
Add this line to your application's Gemfile:
1
gem 'clerk-sdk-ruby', require: "clerk"
Copied!
And then execute:
1
$ bundle install
Copied!
Or install it yourself as:
1
$ gem install clerk-sdk-ruby
Copied!

Quick Start

First, you need to get an API key for a Clerk instance. This is done via the Clerk dashboard.
Then you can instantiate a Clerk::SDK instance and access all Backend API endpoints. Here's a quick example:
1
clerk = Clerk::SDK.new(api_key: "your_api_key")
2
# List all users
3
clerk.users.all
4
# Get your first user
5
user = clerk.users.all(limit: 1).first
6
# Extract their primary email address ID
7
email_id = user["primary_email_address_id"]
8
# Send them a welcome email
9
clerk.emails.create(
10
email_address_id: email_id,
11
from_email_name: "welcome",
12
subject: "Welcome to MyApp",
13
body: "Welcome to MyApp, #{user["first_name"]}",
14
)
Copied!
Last modified 1mo ago
Copy link
Edit on GitHub
Contents
Quick Start