Skip to main content

Zitadel Ruby SDK

Seamlessly integrate Zitadel’s identity and access management into your Ruby applications with three flexible authentication methods and comprehensive API coverage.

# Install the SDK
gem install zitadel-client
# Initialize with PAT
client = Zitadel::Client::Zitadel
.with_access_token(
“your-token”
)

Get started in minutes

Install the SDK, choose your authentication method, and start managing users and resources

1

Install the SDK

Add the Zitadel Ruby SDK to your project using RubyGems or Bundler:
gem install zitadel-client
Requires Ruby 3.0 or higher
2

Choose authentication method

Select the authentication method that fits your needs:

Private Key JWT

Most secure for production

Client Credentials

Simple server-to-server

Personal Access Token

Quick setup for development
3

Initialize the client

Create a client instance with your chosen authentication method:
require 'zitadel-client'

# Using Personal Access Token
client = Zitadel::Client::Zitadel.with_access_token(
  "https://example.us1.zitadel.cloud",
  "your-access-token"
)
4

Make your first API call

Start managing users, organizations, and applications:
require 'securerandom'

response = client.users.add_human_user(
  Zitadel::Client::UserServiceAddHumanUserRequest.new(
    username: SecureRandom.hex,
    profile: Zitadel::Client::UserServiceSetHumanProfile.new(
      given_name: 'John',
      family_name: 'Doe'
    ),
    email: Zitadel::Client::UserServiceSetHumanEmail.new(
      email: "[email protected]"
    )
  )
)

puts "User created: #{response.user_id}"
{
  "userId": "123456789012345678",
  "details": {
    "sequence": "1",
    "changeDate": "2024-03-04T10:30:00Z",
    "resourceOwner": "987654321098765432"
  }
}

Explore the SDK

Comprehensive APIs for identity and access management

User management

Create, update, and manage human and machine users

Organizations

Handle multi-tenant organization structures

Applications

Configure OAuth, OIDC, and SAML applications

Sessions

Manage user sessions and authentication states

OIDC integration

Integrate with OpenID Connect providers

Projects

Organize applications and resources by project

Key features

Three authentication methods

Choose between Private Key JWT, Client Credentials, or Personal Access Tokens based on your security and simplicity needs

Comprehensive API coverage

Full access to stable and beta APIs for users, organizations, projects, applications, sessions, and identity providers

Built-in error handling

Robust error handling with detailed error messages and debug logging support for troubleshooting

Zeitwerk autoloading

Efficient module management with Zeitwerk-based autoloading for fast load times and clean namespace organization

Ready to integrate Zitadel?

Start building secure authentication and authorization into your Ruby applications today

Build docs developers (and LLMs) love