Getting Started

Installation

npm i @rps-labs/lotto-sdk
  • React Hooks: Our SDK provides a collection of React hooks that simplify the process of integration. These hooks are designed to be easy to use and customizable, allowing you to tailor the gamification experience to your specific requirements.

  • Prebuilt UI Components: We offer a selection of prebuilt UI components that are ready to be dropped into your application. Whether you need to display Prize Pool information, highlight Past Winners, showcase Leaderboards, or user activity, our SDK has you covered.

  • RPS Integration: Our SDK integrates directly into our backend data and smart contract.

Usage

The RPSProvider is a wrapper component that provides access to all of the SDK’s hooks and UI components. It utilizes the Provider Pattern to share data with all of the components that are nested within it.

Wrap your app in the RPSProvider to access the SDK’s functionality from anywhere in your app.

API Keys

You will require an API key to use RPS Labs' infrastructure services with the SDK. Obtain an API key by contacting lfg@rpslabs.io and then pass as a prop to theRPSProvider.

import { RPSProvider } from "@rps-labs/lotto-sdk";

function App() {
  return (
    <RPSProvider activeChain="ethereum" apiKey="your-api-key" theme="dark">
      <YourApp />
    </RPSProvider>
  );
}

Configurations

activeChain (recommended)

The activeChain prop determines which chain you want your app to be operating on.

apiKey (recommended)

The apiKey prop is required to use the RPS infrastructure services with the SDK.

theme (optional)

The theme prop is an optional prop that lets you choose between light and dark mode variants of our components.

Last updated