Skip to content

React.js demo app showing the use of Cleeng MediaStore API. It includes checkout, identity management, and my account functionalities.

License

Notifications You must be signed in to change notification settings

Cleeng/mediastore-api-example

Repository files navigation

Build Tests

MediaStore API Example

This repo is an example app which shows how to integrate with Cleeng MediaStore API. It consists of components that will empower you to build and design a seamless checkout process, help visitors become subscribers, and then allow them to manage their subscription.

Installation

Prerequisites

  • node v14.15.0
  • yarn

Follow commands

git clone https://github.com/Cleeng/mediastore-api-example
cd mediastore-api-example
yarn install
yarn start --environment=sandbox runWithTestOffer

App live server will be opened on http://localhost:3003. If you run the app with runWithTestOffer param, it will be opened with a sample offer and publisher on http://localhost:3003/login?offer=S817681481_PL&publisher=933103327.

Below you can find a list with available scripts.

Command Description
yarn start Starts the live server in development mode. Takes config from `config/environments/development.js`. Add this file to enable run this command (rename `sandbox.js` file or copy it into `development.js`)
yarn build Builds the app for production to the build folder.
yarn test Launches the test runner in the interactive watch mode.

Links

Check the live demo app here.

Here you can find documentation:

Looking for specific details?

Architecture overview

MediaStore API Example is a frontend application build with React. It was bootstrapped with Create React App. We are using a webpack to build it, Jest, and Enzyme for testing, Styled Components for styles.

This application is communicating with the backend REST API. All methods available can be found here.

The app requires params to working properly.

To enable login action pass offerId to the app. Login is also possible using publisherId, but in the sample app, we use offerId. To enable registration, pass publisherId which is required to fetch terms and conditions.

You can pass it in two ways:

In URL as a param ?offer=S1234567 / ?publisher=123456789 and this is the most important one

In local storage as CLEENG_OFFER_ID / CLEENG_PUBLISHER_ID

Sample:http://localhost:3003/login?offer=S817681481_PL&publisher=933103327

License

The Cleeng Media Store SDK is open source and available under the BSD 3-Clause License. See the LICENSE file for more info.

About

React.js demo app showing the use of Cleeng MediaStore API. It includes checkout, identity management, and my account functionalities.

Topics

Resources

License

Stars

Watchers

Forks

Languages