> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.usebridge.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.usebridge.com/_mcp/server.

# Ruby

Bridge provides a Ruby client for interacting with the Bridge API. The generated SDK provides idiomatic resource methods, automatic authentication, and consistent error handling.

## Features

* **Idiomatic Ruby**: Snake-case methods and keyword arguments
* **Authentication**: Automatic API key handling
* **Error Handling**: Typed errors with API response details
* **Generated Resources**: Methods and models generated from the Bridge API specification
* **Environment Support**: Built-in Production and Sandbox configuration

## Installation

Add the SDK to your Gemfile:

```ruby
gem "usebridge-api"
```

Then install it:

```bash
bundle install
```

## Quick Start

```ruby
require "BridgeApi"

client = BridgeApi::Client.new(
  api_key: ENV.fetch("BRIDGE_API_KEY"),
  environment: BridgeApi::Environment::PRODUCTION
)

patient = client.patients.v_2.create_patient(
  first_name: "Jane",
  last_name: "Smith",
  email: "patient@example.com",
  date_of_birth: "2000-01-01"
)
```

Use `BridgeApi::Environment::SANDBOX` when testing against the Sandbox environment.

## Resources

#### [RubyGems Package](https://rubygems.org/gems/usebridge-api)

#### [GitHub Repository](https://github.com/use-bridge/api-ruby)

#### [API Reference](/api)

#### [Testing Guide](/api/resources/testing)