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
bash
import { 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.

Get an API key

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

Get an API key