Installation

Getting started with Nen is incredibly easy. We provide a CLI tool to scaffold everything you need, or you can install the packages manually.

Using the CLI (Recommended)

The easiest way to add Nen to an existing Next.js App Router project. It installs @withnen/client and @withnen/server, patches next.config.ts for WebAssembly, and generates the session route at src/app/api/nen/[action]/route.ts.

npx create-nen-app@latest my-secure-app

Once the setup is complete, navigate to your project and start the development server:

cd my-secure-app
npm run dev

Manual Installation

If you want to integrate Nen into an existing project, you can install the client and server packages via npm.

npm install @withnen/client @withnen/server

Prerequisites

  • Node.js 18 or later
  • Next.js 13+ with the App Router
  • A modern browser that supports WebAssembly (for the client engine)

WebAssembly config (manual install only)

The CLI patches this automatically. If you installed manually, add the following to next.config.ts so Next.js bundles the Wasm core:

// next.config.ts
const nextConfig = {
  experimental: {
    asyncWebAssembly: true,
  },
};
export default nextConfig;

Without this, the client will throw a Wasm load error on first use.

Next, head over to the Usage guide to see how to integrate Nen into your routes.