# Ruby SDK (ingest)

> Quickly integrate the Ours Privacy Ruby SDK using Bundler. Send test requests from the Track Events API reference.

Source: https://docs.oursprivacy.com/docs/ruby

Use this page to install the Ours Privacy Ruby SDK and send events from your server. Every request takes your Ingest API source's API key as `token`. Copy it from the **API Keys** card on the source's **Settings** tab.

## Installation

Install the SDK via Bundler by adding the following to your application's `Gemfile`:

```ruby
gem "oursprivacy-ingest"
```

Then run:

```bash
bundle install
```

For more details, visit the [RubyGems repository](https://rubygems.org/gems/oursprivacy-ingest) | [Github Repo](https://github.com/with-ours/ingest-sdk-ruby)

## Usage

Create a client and track an event:

```ruby
require "bundler/setup"
require "oursprivacy_ingest"

ours_privacy = OursprivacyIngest::Client.new

# Track an event
response = ours_privacy.track.event(token: "your-source-token", event: "Purchase")

puts(response.success)
```

## Next Steps

* [Ingest API Integration](https://docs.oursprivacy.com/docs/server-to-server-integration): match events to visitors, backfill past events, and test with a Test Mode key.
* [Track Events API reference](https://docs.oursprivacy.com/docs/reference/track) and [Identify Visitors API reference](https://docs.oursprivacy.com/docs/reference/identify): every field the SDK accepts.
* [Ruby SDK on GitHub](https://github.com/with-ours/ingest-sdk-ruby): retries, timeouts, and error handling.
