Back to docs
Quickstart
Next.js starter
Clone the Meridian starter template and ship your first licensed Next.js app in under two minutes. Batteries included — route handlers, middleware, and license validation.
Clone the repo
Pull the template from GitHub and install dependencies.
git clone https://github.com/meridian/starter-nextjs.git
cd starter-nextjs
npm install
View on GitHubcd starter-nextjs
npm install
Route handler example
A minimal API route that validates a license key before returning protected data.
// app/api/validate/route.ts
import { NextRequest, NextResponse } from "next/server";
export async function POST(req: NextRequest) {
// Validate license via Meridian API
const body = await req.json();
const { licenseKey } = body;
const res = await fetch(
"https://api.getnimbus.net/v1/validate",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ licenseKey }),
}
);
if (!res.ok) return NextResponse.json(
{ error: "Invalid license" },
{ status: 401 }
);
return NextResponse.json(
{ data: "Protected content" }
);
}
import { NextRequest, NextResponse } from "next/server";
export async function POST(req: NextRequest) {
// Validate license via Meridian API
const body = await req.json();
const { licenseKey } = body;
const res = await fetch(
"https://api.getnimbus.net/v1/validate",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ licenseKey }),
}
);
if (!res.ok) return NextResponse.json(
{ error: "Invalid license" },
{ status: 401 }
);
return NextResponse.json(
{ data: "Protected content" }
);
}