0.15.1 • Published 1 year ago

@gamefi-org/id-react v0.15.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@gamefi-org/id-react

The frontend SDK for GameFi.org ID built for React.

Installation

npm i @gamefi-org/id-react

Usage

@gamefi-org/id-react comes with a state-manager powered by zustand. In order to get started, we first need to bootstrap the SDK with configuration.

import { init } from '@gamefi-org/id-react';
init({
  recaptcha: 'Recaptcha client key',
  gsi: 'Google Sign-In client key',
  baseURL: 'GameFi.org ID API endpoint',
  rpcs: {
    // endpoints for web3 connectors
  },
});

From here, we can use the SDK with its components, hooks and utilities.

import { Toaster, useID } from '@gamefi-org/id-react';
import SignIn from '@gamefi-org/id-react/dist/SignIn';
import Profile from '@gamefi-org/id-react/dist/Profile';

// singleton service for toasting messages.
<Toaster
  toastOptions={{
    style: {
      minWidth: '350px',
      maxWidth: '70%',
    },
  }}
/>;

// rendering the Profile and SignIn modal.
const { user } = useID();
if (user) {
  return <Profile />;
}

return <SignIn />;

That's it.
For better understanding, we would recommend checking the Storybook and the Next.js example.

0.15.1

1 year ago

0.15.0

1 year ago

0.14.0

1 year ago

0.13.4

1 year ago

0.13.5

1 year ago

0.13.3

1 year ago

0.13.0

1 year ago

0.13.1

1 year ago

0.13.2

1 year ago

0.13.0-next.0

1 year ago

0.12.4

1 year ago

0.12.3

2 years ago

0.12.1

2 years ago

0.12.2

2 years ago

0.12.0

2 years ago

0.10.0-next.11

2 years ago

0.10.0-next.10

2 years ago

0.10.0-next.13

2 years ago

0.10.0-next.12

2 years ago

0.10.0-next.9

2 years ago

0.10.0-next.7

2 years ago

0.10.0-next.8

2 years ago

0.10.0-next.5

2 years ago

0.10.0-next.6

2 years ago

0.11.0

2 years ago

0.10.0-next.15

2 years ago

0.10.0-next.3

2 years ago

0.11.1

2 years ago

0.10.0-next.14

2 years ago

0.10.0-next.4

2 years ago

0.10.0-next.17

2 years ago

0.10.0-next.16

2 years ago

0.10.0-next.2

2 years ago

0.10.0-next.19

2 years ago

0.10.0-next.18

2 years ago

0.10.0-next.20

2 years ago

0.10.0-next.22

2 years ago

0.10.0-next.21

2 years ago

0.10.0-next.24

2 years ago

0.10.0-next.23

2 years ago

0.10.1

2 years ago

0.10.2

2 years ago

0.10.0

2 years ago

0.10.0-next.1

2 years ago

0.10.0-next.0

2 years ago

0.9.0

2 years ago

0.8.5

2 years ago

0.8.4

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.6.0-next.1

2 years ago

0.6.0-next.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago