# Ruby Backend SDK 4.0

We're excited to announce the release of the Clerk Ruby Backend SDK 4.0! Below is a quick preview of the major changes that we've made.

## First-Class Framework Support

In the past, outside of the standard Rails configuration, you had to create your own adapters and helpers to work with Clerk. With this release, we've added or expanded on first-class support for Rails, Rails API, Sinatra, and Rack so that everything works out of the box for the most popular frameworks and configurations.

Here's a quick preview of what 4.0 offers:

```ruby
Clerk.configure do |config|
  config.secret_key = 'sk_live_*****'
end

sdk = Clerk::SDK.new
sdk.users.get_user('*****')
```

```ruby
class AdminController < ApplicationController
  include Clerk::Authenticatable

  def index
    @user = clerk.user
  end
end
```

```ruby
# Sinatra
class App < Sinatra::Base
  register Sinatra::Clerk

  get "/admin" do
    @user = clerk.user
    erb :index, format: :html5
  end
end
```

## OpenAPI

We've also brought the SDK into full alignment with our Backend API thanks to now generating parts of the SDK from our [OpenAPI spec](https://github.com/clerk/openapi-specs).

You can view the full generated [documentation on GitHub](https://github.com/clerk/clerk-http-client-ruby/tree/main/.generated#documentation-for-api-endpoints).

## Upgrading

Upgrade your gem by installing version `~> 4.0.0`:

filename: Gemfile
```ruby
gem 'clerk-skd-ruby', '~> 4.0.0', require: 'clerk'
```

## Breaking Changes

Please note that this release contains a number of breaking changes. Please refer to the [upgrade guide](https://clerk.com/docs/references/ruby/v4-upgrade-guide.md) for more information.
