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
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