Gate a Next.js route in five lines
Drop EntrosGate into a Next.js app and require a verified human Trust Score before a page renders.
The shortest path to a verified-human gate. Wrap any component in <EntrosGate>, set a minTrustScore, and the page renders only for wallets whose on-chain Anchor meets the threshold and verified recently enough.
This is the Tier 3 read-only path: you read existing on-chain Anchors rather than running verification yourself. It fits display, progressive disclosure, and gates where a live capture would cost more friction than the action is worth.
For an airdrop claim, a governance vote, or anything else worth the friction, run a verification at the point of the action and let the gate read the result. That is the Tier 1 path, <EntrosVerify />, and it composes with this one: see Verification flow.
Prerequisite.
EntrosGatedepends on the Solana wallet adapter providers (ConnectionProvider,WalletProvider,WalletModalProvider). The component throws at render time without them. Step 2 below sets them up — do that first if your app doesn't already have a wallet adapter wiring at the root.
1. Install
npm install @entros/pulse-sdk @solana/wallet-adapter-react @solana/wallet-adapter-react-ui @solana/web3.js lucide-reactThe SDK is published as @entros/pulse-sdk on npm. It declares @coral-xyz/anchor, @solana/spl-token, @solana/wallet-adapter-base and @solana/web3.js as optional peers. EntrosGate renders WalletMultiButton in its disconnected-state fallback, which is why @solana/wallet-adapter-react-ui is on the install list, and it uses icons from lucide-react.
2. Set up the wallet adapter providers
EntrosGate reads from useWallet() and useConnection(), and its fallback renders WalletMultiButton. All three need provider wrappers at the app root. If your app already has the standard Solana wallet adapter setup, skip to Step 3. Otherwise:
"use client";
import { ConnectionProvider, WalletProvider } from "@solana/wallet-adapter-react";
import { WalletModalProvider } from "@solana/wallet-adapter-react-ui";
import { useMemo } from "react";
export function SolanaProviders({ children }: { children: React.ReactNode }) {
const endpoint = useMemo(
() => process.env.NEXT_PUBLIC_SOLANA_RPC ?? "https://api.devnet.solana.com",
[],
);
return (
<ConnectionProvider endpoint={endpoint}>
<WalletProvider wallets={[]} autoConnect>
<WalletModalProvider>{children}</WalletModalProvider>
</WalletProvider>
</ConnectionProvider>
);
}Mount SolanaProviders once around your app in app/layout.tsx:
import { SolanaProviders } from "./providers";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<SolanaProviders>{children}</SolanaProviders>
</body>
</html>
);
}You also need the wallet-adapter-ui stylesheet imported once. Add it to your global CSS or root layout:
import "@solana/wallet-adapter-react-ui/styles.css";3. Add the gate component
EntrosGate is published as a single-file React component you copy into your project. The canonical source is in the entros.io repo at src/components/ui/entros-gate.tsx—copy it into your own components/ directory. A standalone npm package is on the near-term roadmap.
4. Wrap your protected component
import { EntrosGate } from "@/components/ui/entros-gate";
export default function ProtectedPage() {
return (
<EntrosGate minTrustScore={100}>
<h1>You're verified.</h1>
<p>This view only renders for wallets above the threshold.</p>
</EntrosGate>
);
}That's the integration. EntrosGate does three things:
- Reads the wallet's Anchor PDA on Solana.
- Compares the Trust Score against
minTrustScore, and the last verification againstmaxVerificationAge. - Renders children if both pass, otherwise a fallback prompt linking to
/verify.
Setting the thresholds
minTrustScore is a number between 0 and 10000, the ceiling set by ProtocolConfig.max_trust_score. Scores today top out near 720, so pick from the range below rather than from the ceiling.
maxVerificationAge is seconds since the wallet last verified, and defaults to one day. The two answer different questions: the score is how consistently this wallet has verified, recency is how long ago it last did.
| Stakes | Score floor | Recency | Pattern |
|---|---|---|---|
| Comment / join | 100 | 7 days | Gate alone |
| Mint allowlist / referral reward | 300 | 1 day | Gate alone |
| Airdrop claim / governance | 550+ | 1 hour | Verify at the action, then gate |
| High-value access | 680+ | 1 hour | Verify at the action, then gate |
Higher thresholds ask for a longer verified history. Lower ones keep the protocol open to first-time humans. Above the mint-allowlist row, pair the gate with a verification at the point of the action so the score is read against someone who is present.
<EntrosGate minTrustScore={550} maxVerificationAge={3600}>
<ClaimButton />
</EntrosGate>What the user sees
If the connected wallet has no Anchor: a prompt linking to https://entros.io/verify by default (configurable via the verifyHref prop if you self-host the verification flow).
If the wallet has an Anchor below the score floor, or has not verified inside maxVerificationAge: a re-verify prompt.
If the wallet meets both: your component.
The component doesn't open wallet adapter modals on its own. Wallet connection is the user's responsibility, then <EntrosGate> handles the rest.
Next steps
- Show a Trust Score badge without gating
- Read the Anchor PDA without the SDK—useful for server-side checks
- Configure SAS attestations for cross-program composability