Giter Site home page Giter Site logo

tremendous-embed-rails-sample's Introduction

Tremendous Embed Rails Sample App

This is a sample implementation of the Tremendous Embed module within a Rails application.

Getting Started

First, to receive your sandbox API keys, sign up through the Tremendous sandbox.

Configuration

Add an .env file within this project's root with the follow envvars:

TREMENDOUS_REST_API_HOST=https://testflight.tremendous.com/api/v2/
TREMENDOUS_API_PRIVATE_KEY=YOUR_SANDBOX_API_PRIVATE_KEY
TREMENDOUS_EMBED_PUBLIC_KEY=YOUR_EMBED_SANDBOX_PUBLIC_KEY

Build

bundle
rake db:migrate
rake catalog_update

Run Server

rails s

Getting Started

The heart of the integration is located in a combination of rewards_controller.rb and the associated rewards views.

At a high level, the backend encrypts your reward order JSON using your private API keys. That encrypted JSON is passed to the embed client SDK as a JWT to create a reward via the frontend SDK (see new.html.erb for an example). The reward must then be passed to your backend and approved via the REST API.

Additional Documentation

The embed SDK documentation can be found here. The REST documentation can be found here.

tremendous-embed-rails-sample's People

Contributors

bpless avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.