Skip to main content

Requirements

  • Next.js 14+ (proxy/middleware guidance below includes Next.js 16 conventions)
  • React 18+
  • Node 18+

Packages

pnpm add @wacht/nextjs @wacht/jsx @wacht/types

Environment Variables

NEXT_PUBLIC_WACHT_PUBLISHABLE_KEY=pk_test_xxx
WACHT_API_KEY=wk_live_xxx
No. If you are not calling Wacht backend APIs from server routes/actions, only NEXT_PUBLIC_WACHT_PUBLISHABLE_KEY is required.
No. The SDK derives it from the publishable key to keep behavior consistent across runtimes.
Yes for client provider usage, but the recommended server protection path is proxy/middleware with App Router style server integration.

Verify Installation

import { DeploymentProvider } from '@wacht/nextjs'
import { wachtMiddleware } from '@wacht/nextjs/server'
If both imports resolve, package setup is correct.