SDKs

Ruby SDK (server api)

Quickly integrate the Ours Privacy Ruby SDK using Bundler. Explore its features with our Interactive API Explorer.

Ours Privacy Ruby SDK Documentation

This is a quick start guide for integrating the Ours Privacy Ruby SDK into your server-side applications.

Installation

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

gem "oursprivacy-ingest", "~> 0.1.0"

Then run:

bundle install

For more details, visit the RubyGems repository | Github Repo

Usage

Initialize the SDK and send events with just a few lines of code:

require "bundler/setup"
require "oursprivacy_ingest"

ours_privacy = OursprivacyIngest::Client.new

# Track an event
response = ours_privacy.track.event(
  token: "your-api-key",
  event: "Purchase",
  userId: "user123"
)

puts(response.success)

# Identify a user
response = ours_privacy.identify.visitor(
  token: "your-api-key",
  userId: "user123",
  userProperties: {
    email: "user@example.com",
    firstName: "John",
    lastName: "Doe"
  }
)

Explore the API

Want to see what the SDK can do? Try our Interactive API Explorer to experiment with endpoints and features in real time.

How is this guide?

Ours Privacy Ruby SDK Documentation