Next.js

Content Moderation in Next.js

Drop-in moderation for App Router projects.

Route Handlers, Server Actions, and edge-compatible SDK usage.

What it detects

  • Comment forms
  • AI chatbot inputs and outputs
  • User profile fields
  • Image uploads
  • Marketplace listings
  • Custom rules

Why developers choose Vettly

  • Works in App Router and Pages Router
  • Edge-compatible SDK
  • TypeScript-first with full type safety
  • Pairs cleanly with Server Actions
Example request
bash
// app/api/moderate/route.ts
import { Vettly } from '@vettly/sdk';

const vettly = new Vettly({ apiKey: process.env.VETTLY_API_KEY! });

export async function POST(req: Request) {
  const { content } = await req.json();
  const result = await vettly.check({ content, contentType: 'text', policyId: 'default' });
  if (result.action === 'block') {
    return Response.json({ error: result.categories }, { status: 400 });
  }
  return Response.json({ ok: true });
}
Example response
json
{
  "flagged": true,
  "action": "block",
  "categories": {
    "harassment": 0.93,
    "hate": 0.02
  },
  "policy": "default",
  "latency_ms": 142
}

Compared to rolling your own classifier

Vettly returns decisions, not raw scores - your route handler stays a few lines instead of a classification pipeline.

See the AI chatbot pattern

Get an API key

Start making decisions in minutes with a Developer plan and clear upgrade paths.

Get an API key