Examples & Integrations

Next.js Integration

Secure backend-only integration in Next.js apps.

Architecture

  • Browser uploads video to your backend/API route.
  • Server route creates and starts job with secret key.
  • Client polls your backend, not upstream API directly.

Security Notes

  • Store API key in server env only.
  • Rate limit your public route.
  • Validate URL/file inputs before forwarding.

Operational Patterns

  • Use queue-based orchestration for sustained throughput.
  • Separate latency-sensitive traffic from bulk processing workloads.
  • Centralize webhook/event consumption through one idempotent handler.
  • Use dead-letter queue for repeated failures and manual replay.

Go-Live Checklist

  1. Load test with realistic clip duration distribution.
  2. Validate alerting for error rate, queue lag, and failed jobs.
  3. Confirm credit accounting and billing UX alignment.
  4. Prepare escalation template containing job_id + payload summary.

Next.js Route Design

  • Use server actions/API routes as trusted integration boundary.
  • Keep browser payload minimal; resolve sensitive fields server-side.
  • Protect routes with authz and per-user quotas.