Node.js
Content Moderation in Node.js
One npm install, one API call.
Works with Express, Fastify, NestJS, Hono, and serverless runtimes.
What it detects
- • Form submissions
- • Chat messages
- • Comments and replies
- • Profile fields
- • Uploaded media
- • Custom rules
Why developers choose Vettly
- • TypeScript SDK with full types
- • Works with native fetch on Node 18+
- • Edge-runtime compatible
- • Clean error model with retries
Example request
bashimport { Vettly } from '@vettly/sdk';
const vettly = new Vettly({ apiKey: process.env.VETTLY_API_KEY });
const result = await vettly.check({
content: userInput,
contentType: 'text',
policyId: 'default',
});
if (result.action === 'block') return res.status(400).end();Example response
json{
"flagged": true,
"action": "block",
"categories": {
"harassment": 0.93,
"hate": 0.02
},
"policy": "default",
"latency_ms": 142
}Compared to calling provider APIs directly
Vettly normalizes responses across providers and adds retries, evidence, and audit trails out of the box.
Keep exploring
AI Chatbot Moderation API
Moderate inputs and LLM outputs in real time. Block prompt injection, NSFW content, and policy violations before users see them.
Vettly vs OpenAI Moderation
Multi-modal coverage, dashboards, and provider freedom vs text-only checks.
Content Moderation API
One endpoint for text, image, and video moderation.
Content Moderation in Next.js
Add content moderation to a Next.js App Router project in minutes. Route Handlers, Server Actions, edge runtime, policy setup, and safe error handling.