React
How to Block NSFW Content in React
Server-side NSFW gating for any React app.
Keep the API key safe and the UI fast.
What it detects
- • NSFW images on upload
- • Sexual content in messages
- • Suggestive profile photos
- • Explicit text
- • CSAM signals
- • Custom rules
Why developers choose Vettly
- • Server-side check protects the API key
- • Sub-500ms image decisions
- • review action for borderline cases
- • Works in Next.js, Remix, and any React framework
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": "review",
"categories": {
"sexual": 0.88,
"violence": 0.04
},
"policy": "marketplace-safe",
"latency_ms": 318
}Compared to client-side filters
Client-side filters are trivially bypassed. Server-side checks are the only way to actually gate content.
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.