0.0.9 • Published 2 years ago

poh-validator-worldcoin-react v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Proof-of-Humanity Validator Plugin React Component for worldcoin identity

Live dApp demo

https://panda-hazel.vercel.app/ (source code)

Required props

You have to provide these props:

validatorApiUrl (string) – URL of validator API. Validator API for use with this component: Proof-of-Humanity worldcoin Validator API

actionId (string)worldcoin action id action-id you get from https://developer.worldcoin.org/actions

signal (string) – random unique string example: your wallet address

Returned object

  • error (boolean)true in case of error; otherwise false

  • errorMessage (string) – in case of error; otherwise null

  • proof (string): proof-of-humanity (a hex string); null in case of error

Usage with poh-react

import WorldcoinValidator from 'poh-validator-worldcoin-react'
import { useProofOfHumanity } from 'poh-react';

 const validator = (
    <WorldcoinValidator
    actionId={"wid_staging_"}
      validatorApiUrl={"https://backend-phi-plum.vercel.app/api/proof"}
      signal={"0xA6D71B8cb9e36CfC8251d8a9fEE438D64869618C"}
      debug={true}
    />
  );
  const { getProofOfHumanity } = useProofOfHumanity(validator);

Hidden props

These props are used internally by poh-react. Normally you don't bother working with them.

These props are used internally by poh-react. Normally you don't bother working with them.

data (string) – data (a hex string) to be included in signed proof-of-humanity. Can be a random hex challenge, or a random hex challenge along with the address owner's signature

onVerify (function) – will be called from the component once validation is complete with the returned object as the only parameter

Author

spiritbro1

License

MIT

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago