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
Content Moderation API
One endpoint for text, image, and video moderation.
Image Moderation API
Policy-driven image checks with clear allow, review, and block actions.
Video Moderation API
Async video moderation without stitching together multiple vendors.
Content Moderation in Next.js
Add content moderation to a Next.js App Router project in minutes. Server-side API routes, React Server Components, and edge runtime examples.
Get an API key
Start making decisions in minutes with a Developer plan and clear upgrade paths.
Get an API key