Route protection should depend on server-trusted state. The browser status flow is useful for UI feedback, but your backend should decide whether a user can access protected content.
1

Create a verification

Start the flow from your server and attach customerUserRef to link it to your user.
2

Confirm the result server-side

Process a webhook or fetch verifications.getResult(verificationId).
3

Store a verified flag

Write the minimum state you need to your user, membership, or session table.
4

Check that state in middleware

Protect pages with your framework middleware or route guards.

Next.js middleware

Import middleware from @authbound/nextjs/middleware, not from the package root. The root export exists for compatibility, but the dedicated middleware entry keeps Edge bundles smaller.
Next.js 16 renamed middleware.ts to proxy.ts. On Next.js 16, put the same code in proxy.ts; the default export and config work unchanged.
Use withAuthbound when you want SDK route matching and redirects, but keep the verification decision tied to your own session model.
middleware.ts

Keep cookies small

Store only safe booleans in browser-visible state, such as:
Do not store raw credential data, names, dates of birth, addresses, document numbers, or wallet payloads in client-accessible cookies.

Server result lookup