Entros_docs
Integrate

Gate a route

Wrap any React component with EntrosGate to require a Trust Score and a recent verification before children render.

EntrosGate controls client-side display. It renders children when the connected wallet's stored score and verification timestamp meet your display requirements. Protect server data and actions with separate authentication and policy checks where they execute.

Use EntrosVerify when the user needs to complete a new verification. A new capture can update verification recency. It does not guarantee the wallet will meet a higher score floor.

Prerequisite. EntrosGate depends on the Solana wallet adapter providers (ConnectionProvider, WalletProvider, WalletModalProvider). The component throws at render time without them. See Set up the wallet adapter providers in the Next.js quickstart for the snippet.

The full surface

<EntrosGate
  minTrustScore={250}
  maxVerificationAge={86_400}
  fallback={<NotVerifiedView />}
  loadingFallback={<Spinner />}
  verifyHref="https://entros.io/verify"
>
  <ProtectedContent />
</EntrosGate>
PropTypeRequiredDefaultPurpose
minTrustScorenumberyesnoneMinimum on-chain Trust Score to allow children to render
maxVerificationAgenumberno86_400Seconds since the last verification, above which the gate does not pass. Infinity gates on score alone
childrenReactNodeyesnoneWhat to render when the wallet passes the gate
fallbackReactNodenobuilt-in promptWhat to render when the wallet fails the gate
loadingFallbackReactNodenominimal spinnerWhat to render while the PDA is being fetched
verifyHrefstringnohttps://entros.io/verifyWhere the built-in fallback links unverified users

Three render states

The gate has three branches:

  1. No wallet connected. Built-in fallback prompts the user to connect.
  2. Anchor absent, below the score floor, or older than the recency window. Built-in fallback prompts re-verification and links to verifyHref.
  3. Anchor clears both. Children render.

Custom fallback

When the default fallback doesn't fit your design, supply your own:

<EntrosGate
  minTrustScore={500}
  maxVerificationAge={3600}
  fallback={
    <div className="rounded-xl border p-6">
      <h2>Verify to claim</h2>
      <p>
        Claiming needs a Trust Score of 500 and a verification from the last
        hour.
      </p>
      <EntrosVerify
        integratorKey="your-integrator-key"
        onVerified={() => location.reload()}
      />
    </div>
  }
>
  <Airdrop />
</EntrosGate>

The popup lets users verify without leaving the page. The next gate read updates the display if the wallet meets both requirements. The claim endpoint must authenticate the signed action and evaluate current evidence independently.

The fallback prop replaces every failing state: "wallet disconnected", "below the score floor", "verified too long ago" and "no Anchor on file". The default fallback renders WalletMultiButton in the disconnected case, so a custom fallback needs its own connect control or users have no way in. To branch on the states yourself, call verifyEntrosAttestation from the SDK directly inside your own component.

Self-host the verify route

verifyHref defaults to https://entros.io/verify, the canonical hosted verification flow. Unverified users land on entros.io, complete the 12-second behavioral capture, mint or update their Anchor, and return to your app on the next gate read.

If you're hosting the verification flow yourself (e.g. a self-hosted /verify route built on @entros/pulse-sdk), set verifyHref to your route: verifyHref="/verify" for a same-origin route, or an absolute URL for another host.

Redirecting is the fallback of last resort. Prefer <EntrosVerify /> from @entros/verify, which runs the capture in a popup without leaving your page. After success, the next gate read checks whether the wallet meets the display requirements.

Server-side gating

EntrosGate cannot authorize server access or protect data already delivered to the browser. Authenticate a wallet-signed action, read current evidence, evaluate your server's policy, and consume the nonce atomically with the action.

Follow Read verification evidence and the protected-action example. For an on-chain action, enforce the relevant account state and policy in the same transaction.

Where to look next

On this page