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.
EntrosGatedepends 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>| Prop | Type | Required | Default | Purpose |
|---|---|---|---|---|
minTrustScore | number | yes | none | Minimum on-chain Trust Score to allow children to render |
maxVerificationAge | number | no | 86_400 | Seconds since the last verification, above which the gate does not pass. Infinity gates on score alone |
children | ReactNode | yes | none | What to render when the wallet passes the gate |
fallback | ReactNode | no | built-in prompt | What to render when the wallet fails the gate |
loadingFallback | ReactNode | no | minimal spinner | What to render while the PDA is being fetched |
verifyHref | string | no | https://entros.io/verify | Where the built-in fallback links unverified users |
Three render states
The gate has three branches:
- No wallet connected. Built-in fallback prompts the user to connect.
- Anchor absent, below the score floor, or older than the recency window. Built-in fallback prompts re-verification and links to
verifyHref. - 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
- Show a Trust Score badge without gating
- Read verification evidence for non-React contexts
- SAS attestation for cross-program composability