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.

Installation

You can install {tremendousr} via CRAN or GitHub and load it as follows:

# Install released version from CRAN
install.packages("tremendousr")

# Or, install the development version from GitHub
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.