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.

When to Use Next.js Integration

Next.js Integration belongs to the Examples & Integrations section and covers secure backend-only integration in next.js apps.

The page is written for developers and operators who need predictable video background removal behavior in production, not just a one-off demo request.

  • Use this example when next.js integration matches your deployment shape or automation pattern.
  • Start with the reference flow, then replace storage, queue, and database pieces with your production stack.
  • Keep one small fixture video for smoke tests and one difficult video for quality regression checks.

Implementation Notes

Before you promote this workflow, test it with at least one short clip, one longer clip, and one visually difficult clip from your actual product or customer segment.

For support and debugging, persist the original input reference, selected model, output format, credit usage, and final job status alongside your internal user or project id.

  • Do not copy example credentials, callback URLs, or storage paths directly into production.
  • Do not run high-volume jobs synchronously from user-facing request handlers.
  • Do not skip observability; every example should emit enough state to replay or debug failed jobs.

FAQ

QuestionAnswer
Is Next.js Integration required for every integration?Use it when the topic affects your setup, quality target, or operational workflow.
What should I test before going live?Verify success, failure, timeout, retry, and insufficient-credit paths with realistic video files and the same output format you plan to ship.
How does this connect to the rest of the API?Most workflows connect upload or source URL handling, job creation, status polling, output retrieval, usage tracking, and operational logging.