RPS Labs
  • 👋Welcome to RPS Labs
  • 📋Table of Contents
  • Overview
    • 💡What we do
  • ✌️Using Lotto SDK
    • For Users
      • Case Studies
    • For Developers
      • 💸Pricing
      • 🧰SDK Docs
        • Getting Started
        • UI Components
        • Hooks
      • 💻API Docs
        • Raffle info
        • Users
        • Pot
      • 📃Smart Contracts
        • RPS Raffle
        • RPS Router
        • Configurable Raffle Parameters
        • Fund Management
        • Deployment Guide
        • Security Considerations
      • ⛓️Supported Chains
  • RESOURCES
    • 🙋‍♂️Contact & Social Links
    • ❓FAQ
    • 🖌️Brand Assets
  • COMING SOON
    • DailyGM!
    • Hypercluster
Powered by GitBook
On this page
  • Installation
  • Usage
  • Configurations
  1. Using Lotto SDK
  2. For Developers
  3. SDK Docs

Getting Started

Last updated 1 year ago

Installation

npm i @rps-labs/lotto-sdk
yarn add @rps-sdk/react
pnpm i @rps-sdk/react
  • 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 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.

✌️
🧰
Provider Pattern