Learn R Programming

tremendousr

Easily Send Rewards and Incentives from R


tremendous is a platform that "empowers companies to buy, track and manage digital and physical payments." This package provides a slightly-opinionated R interface for the 'Tremendous' API with, dare I say, tremendously intuitive functions for sending rewards and incentives directly from R.

Table of contents


Installation

You can install and load the development version of tremendousr from GitHub as follows:

# Install the development version from GitHub
if (!require("remotes")) install.packages("remotes")
remotes::install_github("jdtrat/tremendousr")

# Load package
library(tremendousr)

Getting Started

Tremendous provides two environments for their platform:

  • 'Sandbox' environment, a "free and fully-featured environment for application development and testing."
  • 'Production' environment, where real payments can be sent.

Tremendous API users typically develop their applications against the sandbox environment, and then switch their credentials to production when they are ready to go live.

Unsurprisingly, in order to use this package, you must create a Tremendous account. For the Sandbox environment, you can sign up or log-in here and generate an API key by navigating to Team Settings > Developers and clicking on Add API key on the top right. You can follow the official documentation here.

With an API key, you can create a Tremendous Client in R and send payments as shown below.

test_client <- trem_client_new(api_key = "TEST_YOUR-KEY-HERE",
                               sandbox = TRUE)

trem_send_reward(client = test_client,
             name = "first last",
             email = "email@website.com",
             reward_amount = 10,
             currency_code = "USD",
             delivery_method = "EMAIL",
             payment_description_id = "payment-from-tremendousr-examples",
             funding_source_id = "your-funding-id-from-tremendous",
             reward_types = "Q24BD9EZ332JT", # ID for virtual visa gift card
             parse = TRUE # Return a parsed API response
             )

Further Reading

For a more in-depth explanation of tremendousr, please see the 'Getting Started' Vignette and the official Tremendous API Documentation.

Feedback

If you want to see a feature, or report a bug, please file an issue or open a pull-request! As this package is just getting off the ground, we welcome all feedback and contributions. See our contribution guidelines for more details on getting involved!

Code of Conduct

Please note that the tremendousr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('tremendousr')

Monthly Downloads

179

Version

1.0.0

License

MIT + file LICENSE

Maintainer

Jonathan Trattner

Last Published

September 30th, 2021

Functions in tremendousr (1.0.0)

trem_client_new

Create a new Tremendous API Client
trem_delete

Perform a DELETE request to Tremendous API
trem_send_reward

Send a Reward via Tremendous API
trem_set_api_key

Set Tremendous API Key in .Renviron
trem_get

Perform a GET request to Tremendous API
trem_post

Perform a POST request to Tremendous API
create_order_body

Create order body
trem_ua

Get useragent info for tremendousr API Package
tremendous_client

R6 Class representing a new Tremendous API Client