Skip to main content

VerifyGate Component

Gate UI behind verification requirements.

Basic Usage

import { VerifyGate } from '@neus/sdk/widgets';

export function Page() {
  return (
    <VerifyGate
      requiredVerifiers={['nft-ownership']}
      verifierData={{
        'nft-ownership': { contractAddress: '0x...', tokenId: '1', chainId: 8453 }
      }}
      appId="neus-network"
    >
      <div>Unlocked</div>
    </VerifyGate>
  );
}

Props Reference

PropTypeDefaultDescription
requiredVerifiersstring[]['ownership-basic']Verifiers to check
verifierDataobject-Data keyed by verifier id
strategystring'reuse-or-create'Proof strategy
proofOptionsobjectprivateProof options
modestring'create'Operation mode
proofIdstring-Required for mode="access"; same receipt ID appears as qHash on HTTP paths
maxProofAgeMsnumber-Max proof age for reuse checks
onErrorfunction-Error callback
apiUrlstring-Custom API base URL
appIdstring-Public app attribution identifier
sponsorGrantstring-Sponsor JWT for sponsored proofs
hostedCheckoutUrlstring-Hosted verify page URL

Strategies

StrategyBehavior
reuse-or-createCheck for existing proof, create if not found
reuseOnly check existing proofs
freshAlways create a new proof

Hosted Checkout

Interactive verifiers (ownership-social, ownership-org-oauth, proof-of-human) automatically use NEUS hosted checkout.
<VerifyGate
  requiredVerifiers={['ownership-social']}
  onVerified={(result) => {
    console.log('Verified:', result.proofId);
  }}
>
  <button>Verify with Social</button>
</VerifyGate>
<VerifyGate
  requiredVerifiers={['ownership-social']}
  appId="neus-network"
  sponsorGrant={sponsorGrantJwt}
  hostedCheckoutUrl="https://neus.network/verify"
>
  <button>Continue</button>
</VerifyGate>

Privacy Options

<VerifyGate
  requiredVerifiers={['ownership-basic']}
  proofOptions={{
    privacyLevel: 'private',
    publicDisplay: false,
    storeOriginalContent: false
  }}
>
  <div>Private gated content</div>
</VerifyGate>