poh-validator-worldcoin-react v0.0.9
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) –truein case of error; otherwisefalseerrorMessage(string) – in case of error; otherwisenullproof(string): proof-of-humanity (a hex string);nullin 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