Quickstart
The Web Discover SDK allows you to provide your users with a customizable e-gifting experience, where users can either select existing gift templates or create their own. The Web Discover SDK is a static, single page application. This means that the entire application will run from a single page, in this case, index.html
.
Prerequisites
- A Vouchr account with access to Vouchr’s API and the Web Discover SDK
- An existing payment site or mobile application that the Web Discover app will launch from
- During local development & testing, a local static http server such as serve, or http-server
Setup
Install
Simply download the Web Discover SDK zip file and unzip the contents. The folder structure is shown below:
Folder Structure
├── index.html
├── config
│ └── config.js
└── static
├── css
├── js
└── media
Configure
To configure the app, edit config/config.js
. This file contains a JS object, that is to be passed in to the app. See below for a complete list of properties that can be configured, and their descriptions.
Property | Type | Required | Description |
---|---|---|---|
apiKey | string |
yes | The API key for your application, as configured on the Vouchr Dashboard under Developer -> App Keys. |
networkKey | string |
yes | The network key for your application, as configured on the Vouchr Dashboard under Developer -> Authentication. |
baseApiUrl | string |
yes | The base API url that the app uses to perform calls to Vouchr endpoints. |
webRevealUrl | string |
yes | The url for a hosted version of the Vouchr Web Reveal SDK for previewing the template. |
paymentType | string |
no | Your application’s payment type, ‘CASHLESS’ by default |
Develop
We provide an example of launching the Web Discover app in index.html
. To run the example, simply open index.html
in a browser. You can use this example for testing and theming purposes, until you are ready to integrate in to an existing site or mobile app.