Available methods
The Ruby SDK mirrors the Backend API(opens in a new tab). The SDK is organized into resources, which are listed below. Each resource has a set of methods that correspond to the API endpoints.
All examples assume you have an instance of the Clerk::SDK
:
sdk = Clerk::SDK.new
Allowlist identifiers
The following methods are available for managing allowlist identifiers(opens in a new tab).
Retrieve the list of allowlist identifiers
sdk.allowlist_identifiers.all
Add a new allowlist identifier
If notify
is true, an email will be sent to notify the owner of the identifier.
sdk.allowlist_identifiers.create(identifier: "john@example.com", notify: true)
Delete an allowlist identifier
sdk.allowlist_identifiers.delete("alid_xyz")
Allowlist
Toggle allowlist-only sign-ups on/off
sdk.allowlist.update(restricted_to_allowlist: true)
Clients
The following methods are available for the clients
(opens in a new tab) resource.
Retrieve a single client
sdk.clients.find("client_xyz")
Retrieve the list of clients
sdk.clients.all
Verify the JWT and return the client
sdk.clients.verify_token("jwt")
Sessions
The following methods are available for managing sessions(opens in a new tab).
Retrieve a single session
sdk.sessions.find("sess_xyz")
Retrieve a list of sessions
sdk.sessions.all
Revoke a session
sdk.sessions.revoke("sess_xyz")
Verify a session to a token
Verify whether a session with a given ID corresponds to the provided session token. Throws an error if the provided ID is invalid.
sdk.sessions.verify_token("sess_xyz", "jwt")
Users
The following methods are available for managing users(opens in a new tab).
Retrieve a list of users
sdk.users.all
You can also filter users by email address:
sdk.users.all(email_address: ["user1@example.com", "user2@example.com"])
Update a user
sdk.users.update("user_xyz", {first_name: "John"})
Delete a user
sdk.users.delete("user_xyz")
Last updated on April 8, 2024