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.

Get an API key

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

Get an API key