You’ll add a verification screen to a React app. The browser shows the QR code, and a small Express server on the same origin talks to Authbound with your secret key.

Before you start

1

Install the SDKs

pnpm add @authbound/react @authbound/server express cookie-parser
2

Add your keys

.env
AUTHBOUND_SECRET_KEY=sk_test_...
AUTHBOUND_SESSION_SECRET=...
AUTHBOUND_PUBLISHABLE_KEY=pk_test_...
VITE_AUTHBOUND_PK=pk_test_...
VITE_AUTHBOUND_POLICY_ID=pol_kyc_basic_authbound_v1
Generate the session secret with openssl rand -base64 32. The VITE_ values end up in the browser bundle, which is fine: publishable keys and policy IDs aren’t secret.
3

Add the server

The Authbound router adds the routes the browser SDK calls: starting a verification and setting a session cookie when it succeeds.
server.ts
import cookieParser from "cookie-parser";
import express from "express";
import { createAuthboundRouter } from "@authbound/server/express";

const app = express();
app.use(express.json());
app.use(cookieParser());

app.use(
  "/api/authbound",
  createAuthboundRouter({
    apiKey: process.env.AUTHBOUND_SECRET_KEY!,
    publishableKey: process.env.AUTHBOUND_PUBLISHABLE_KEY!,
    secret: process.env.AUTHBOUND_SESSION_SECRET!,
    routes: { protected: [], verify: "/verify" },
  })
);

app.listen(3000);
During development, have Vite forward /api to it so both run on the same origin:
vite.config.ts
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";

export default defineConfig({
  plugins: [react()],
  server: { proxy: { "/api": "http://localhost:3000" } },
});
4

Wrap your app in the provider

src/main.tsx
import "@authbound/react/styles.css";
import { asPolicyId, AuthboundProvider } from "@authbound/react";
import { createRoot } from "react-dom/client";
import { App } from "./App";

createRoot(document.getElementById("root")!).render(
  <AuthboundProvider
    publishableKey={import.meta.env.VITE_AUTHBOUND_PK}
    policyId={asPolicyId(import.meta.env.VITE_AUTHBOUND_POLICY_ID)}
  >
    <App />
  </AuthboundProvider>
);
5

Add the verification wall

VerificationWall shows a start button, then the QR code, then its children once the user is verified.
src/App.tsx
import { VerificationWall } from "@authbound/react";

export function App() {
  return (
    <VerificationWall
      title="Verify your identity"
      description="Scan the QR code with your wallet app."
    >
      <h1>You're verified</h1>
    </VerificationWall>
  );
}

Try it

Start the server with npx tsx --env-file=.env server.ts and the app with pnpm dev. Click Start Verification, scan the QR code with your wallet and approve the request. The page switches to “You’re verified”.

Next steps

Receive webhooks

Add a webhook route to the Express server and confirm results there.

Browser sessions

Session modes, several tabs, time limits and proxies.

How it works

Why access decisions belong on your server.

Station UI

For enabled organizations, use StationEntry, StationEntryDisplay and StationOperatorConsole from @authbound/react. The station UI guide explains token scopes and direct Gateway versus same-origin proxy mode.