Convex
Content Moderation with Convex
Moderate content inside Convex actions.
Persist decisions in the Convex database for audit and replay.
What it detects
- • Mutation inputs
- • Action arguments
- • File storage uploads
- • Scheduled job payloads
- • Webhook handlers
- • Custom rules
Why developers choose Vettly
- • External fetch from Convex actions
- • Persist decisions natively
- • Pairs with Convex auth for tenant context
- • Realtime updates after moderation passes
Example request
bash// convex/messages.ts
import { mutation } from './_generated/server';
import { Vettly } from '@vettly/sdk';
const vettly = new Vettly({ apiKey: process.env.VETTLY_API_KEY! });
export const send = mutation(async ({ db }, { content, userId }) => {
const result = await vettly.check({ content, contentType: 'text', policyId: 'chat' });
if (result.action === 'block') throw new Error('Content blocked');
await db.insert('messages', { content, userId });
});Example response
json{
"flagged": true,
"action": "block",
"categories": {
"harassment": 0.93,
"hate": 0.02
},
"policy": "default",
"latency_ms": 142
}Compared to client-side moderation
Server-side moderation in Convex actions is the only place the API key stays safe and decisions stay tamper-proof.
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.