npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@elevora/react

v0.1.15

Published

Official SDK for Elevora's public API

Downloads

959

Readme

@elevora/react

⚠️ Warning: This SDK is currently under active development and may undergo significant changes. Use with caution in production environments.

Official React SDK for Elevora's public API. This SDK provides easy integration with Elevora's waitlist and referral system.

Requirements

Signup on elevora.app and setup a campaign

Installation

npm install @elevora/react axios @tanstack/react-query react

Quick Start

  1. Wrap your application with the ElevoraProvider:
tsx
import { ElevoraProvider } from '@elevora/react';

function App() {
    return (
        <ElevoraProvider campaignSlug="your-campaign-slug">
            <YourApp />
        </ElevoraProvider>
    );
}
  1. Use the useElevora hook in your components:
import { useElevora } from '@elevora/react';

function YourComponent() {
    const { rewards, userEntry, isConnected } = useElevora();
    return (
        <div>
            {isConnected ? (
            <p>Welcome back!</p>
            ) : (
            <p>Please sign in</p>
            )}
        </div>
    );
}

Web3 Integration

The SDK includes built-in support for Web3 authentication using the useWeb3Login hook:

import { useWeb3Login } from '@elevora/react';

function LoginComponent() {
    const { login, isConnected, address } = useWeb3Login({
        autoLogin: true // Optional: automatically attempts login when wallet is connected
    });

    return (
    <button onClick={login}>
        Connect Wallet
    </button>
    );
}

API Reference

ElevoraProvider

The main provider component that enables access to Elevora's functionality.

Props:

  • campaignSlug (required): The unique identifier for your campaign
  • children: React nodes to be wrapped by the provider

useElevora Hook

Returns an object containing:

  • campaignSlug: Current campaign identifier
  • rewards: Campaign details and rewards information
  • userEntry: Current user's entry information
  • setToken: Function to set the authentication token
  • isConnected: Boolean indicating if user is authenticated

useWeb3Login Hook

Returns an object containing:

  • login: Function to initiate Web3 login
  • isConnected: Boolean indicating if wallet is connected
  • address: Connected wallet address

Options:

  • autoLogin: Boolean to enable automatic login (default: true)

Types

The SDK exports all API types from the @elevora/react/schemas path:

import { PublicCampaignsDto, UserEntryPublicDto } from '@elevora/react/schemas';

Made with ❤️ by Thibault Mathian