Search…
Available methods
The Ruby SDK mirrors the Backend API. Here's a list of the instance methods on the Clerk::SDK and the API endpoint each one corresponds to:
Instance method on SDK object
API endpoint/prefix
Methods on resource object
allowlist_identifiers
all create delete
allowlist
update
clients
all find verify_token
emails
create
sessions
all find revoke verify_token
sms_messages
create
users
/v1/users
all find update delete

Examples

All examples assume you have an instance of the Clerk::SDK:
1
sdk = Clerk::SDK.new
Copied!

Allowlist identifiers

Get an array of all allowlist identifiers:
1
sdk.allowlist_identifiers.all
Copied!
Create a new allowlist identifier:
1
sdk.allowlist_identifiers.create(identifier: "[email protected]", notify: true)
Copied!
Delete an allowlist identifier:
1
sdk.allowlist_identifiers.delete("alid_xyz")
Copied!

Allowlist

Toggle allowlist-only sign-ups on/off:
1
sdk.allowlist.update(restricted_to_allowlist: true)
Copied!

Clients

Get a client by its ID:
1
sdk.clients.find("client_xyz")
Copied!
Get an array of all clients:
1
sdk.clients.all
Copied!
Verify the JWT and return the client:
1
sdk.clients.verify_token("jwt")
Copied!

Emails

Send an email:
1
sdk.emails.create(
2
email_address_id: "ema_xyz",
3
from_email_name: "noreply",
4
subject: "Welcone",
5
body: "<html>...</html>",
6
)
Copied!

Sessions

Get a session by its ID:
1
sdk.sessions.find("sess_xyz")
Copied!
Get an array of all sessions:
1
sdk.sessions.all
Copied!
Revoke a session:
1
sdk.sessions.revoke("sess_xyz")
Copied!
Verify the JWT of a specific session ID:
1
sdk.sessions.verify_token("sess_xyz", "jwt")
Copied!

SMS Messages

Send an SMS:
1
sdk.sms_messages.create(phone_number_id: "idn_xyz", message: "Welcome!")
Copied!

Users

Get an array of all users:
1
sdk.users.all
Copied!
Get an array of users, with filters:
1
sdk.users.all(email_address: ["[email protected]", "[email protected]"])
Copied!
Update a user:
1
sdk.users.update("user_xyz", {first_name: "John"})
Copied!
Delete a user:
1
sdk.users.delete("user_xyz")
Copied!
Last modified 3mo ago