For the complete documentation index, see llms.txt. This page is also available as Markdown.

Web inference-sdk

JavaScript WebRTC reference for existing Serverless Video Streaming integrations. Use Cloud Streaming for new managed live-camera deployments.

The hosted WebRTC integration below uses the deprecated Serverless Video Streaming API. For new managed live-camera deployments, use Cloud Streaming. Its source, job, and result interfaces are separate from the WebRTC methods on this page.

What is WebRTC Streaming?

@roboflow/inference-sdk enables real-time video streaming from your browser to Roboflow's inference servers using WebRTC. This allows you to:

  • Execute Workflows - Run complex multi-step computer vision pipelines

  • Access All Models - Use any Roboflow model type

  • Server-Side Processing - Leverage powerful GPUs

  • Low Latency - WebRTC provides near-real-time results

  • Bidirectional Communication - Send and receive data during streaming

Installation

npm install @roboflow/inference-sdk

Quick Start

Take a look at the video/sample code below to get started:

🔐 Security Best Practices

NEVER expose your API key in frontend code for production applications.

The connectors.withApiKey() method is convenient for demos but exposes your API key in the browser. For production, always use a backend proxy:

Secure Production Pattern

Frontend:

Backend (Express):

Key Features

Dynamic Output Reconfiguration

Change stream and data outputs at runtime without restarting:

Complete Working Example

For a full working example with both frontend and backend code, see the sample application repository. The sample app demonstrates:

  • Proper backend proxy setup for API key security

  • Camera streaming integration

  • Error handling and connection management

  • Production-ready patterns

Resources

Last updated

Was this helpful?