CustomerGlu enables growth teams to run gamified programs in minutes using a low-code builder. This guide will help you integrate the CustomerGlu React SDK into your web application.
Quickstart Guide
This Quickstart Guide will walk you through integrating CustomerGlu's React web SDK in a sandbox environment and launching a few campaigns.
Install the SDK package using NPM
Installation
Or if you wish to set up your existing React project with CustomerGlu React SDK, you can install the latest package from npm and import it into your project as follows:
You can install the package using npm or yarn:
npminstall@customerglu/react-web-sdk
Getting gluToken and userId from Postman
You will need a gluToken and userId to interact with our React Component. Follow these steps to get them using Postman:
Use Register the User request to get the userId and gluToken
Fill in the relevant userId and writeKey in the request body.
After sending the request you'll receive a token as gluToken in the response body.
Note: Any relevant UserId can be provided.
Usage
Here’s a basic example of how to use the component in your project:
Start by cloning our pre-configured CodeSandbox template for React Web:
Please replace the gluToken and userId obtained by Register the User.Also, add the relevant region.In the CodeSandbox, a test gluToken and userId with a relevant campaign have already been provided.
To complete activities for the user, you can use CustomerGlu Debugger from the CustomerGlu Dashboard or you can also use the following API call via Postman:
Upon refresh, you should see the relevant banner or campaign being rendered in the app.
If you face any issues in the above setup, please contact us via the support channel.