A long-lived project that still receives updates
Ruby library for the Trophy API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 0.0, < 1.0
>= 1.10, < 3.0
>= 1.0, < 4.0
>= 1.0, < 3.0
 Project Readme

Trophy Ruby SDK

The Trophy Ruby SDK provides convenient access to the Trophy API from applications written in the Ruby language.

Trophy provides APIs and tools for adding gamification to your application, keeping users engaged through rewards, achievements, streaks, and personalized communication.

Installation

You don't need this source code unless you want to modify the gem. If you just want to use the package, just run:

gem install trophy_api_client

If you want to build the gem from source:

gem build trophy_api_client.gemspec

Usage

The package needs to be configured with your account's API key which is available in the Trophy dashboard.

require 'trophy_api_client'
include TrophyApiClient

client = TrophyApiClient::Client.new(
  api_key: 'YOUR_API_KEY'
)

result = client.metrics.event(
  :key => 'words-written',
  :user => {
    :id => '18',
    :email => 'jk.rowling@harrypotter.com'
  },
  :value => 750
)

Documentation

See the Trophy API Docs for more information on the accessible endpoints.