Roboflow + Web Browser

Run Roboflow models in a web page with inferencejs, on images or a webcam, or stream video to Roboflow's servers with the web inference SDK.

Roboflow has two ways to add computer vision to a web page. inferencejs loads a supported model into the browser and runs it on the visitor's device, taking images or video elements such as a webcam feed as input. It authenticates with your workspace's publishable key, never your private API key.

The second option, @roboflow/inference-sdk, keeps inference on Roboflow's servers: the browser streams camera video over WebRTC, our GPUs run your Workflow, and results come back as video and data. It works with any Roboflow model type and multi-step Workflows. In production a backend holds the API key and the page connects through it.

How to connect Web Browser to Roboflow

5 steps
  1. Copy your publishable key

    Find the publishable key in your Roboflow workspace settings. inferencejs uses this key, not your private API key.

  2. Install inferencejs

    Run npm install inferencejs, or add the jsDelivr script tag for inferencejs to your page's head.

  3. Load your model

    Start a worker with your model ID, version and publishable key. Supported architectures include RF-DETR, Roboflow 3.0, YOLOv5 and YOLOLite.

  4. Run inference on images or video

    Pass an image or an HTMLVideoElement, such as a webcam feed, to infer and draw the predictions on the page.

  5. Stream to the cloud for heavier work

    For models inferencejs does not support, or multi-step Workflows, use @roboflow/inference-sdk to stream camera video over WebRTC to Roboflow's servers.

What teams build with Web Browser

  • Add a webcam demo to a web page

    Run a model on the visitor's webcam with no server to maintain, as in our hand detector demo.

  • Run a full Workflow on live video

    Stream the browser camera to Roboflow's GPUs and get Workflow results back in real time.

Questions

The current in-browser library is inferencejs, installed from npm as inferencejs.

inferencejs supports RF-DETR, Roboflow 3.0 (YOLOv8-compatible), YOLOv5, YOLOLite and Gaze Detection. Other models and Workflows run through @roboflow/inference-sdk on Roboflow's servers.

Use the publishable key with inferencejs; it is meant for the browser. Never ship your private API key. With @roboflow/inference-sdk in production, connect through a backend proxy that holds the key.

Why are companies choosing Roboflow?

The end-to-end platform for vision AI: create datasets, train models and deploy to production.

  • Flexible deployment modes

    Move from a scalable cloud API to edge hardware like NVIDIA Jetson without managing complex dependencies.

  • Integrated workflow builder

    Combine multiple AI models, custom business logic and third-party integrations into one production-ready pipeline in a low-code editor.

  • Model monitoring and alerts

    Dashboards track confidence, inference time and request volume for your deployed models, and email alerts tell your team when confidence suddenly drops.

View all
Get started

Build on the Platform

For developers, engineers, and technical founders who want to get hands on. Try the free tier; the docs are open.

Bring it into your operation

For heads of AI, operations leaders, and enterprise teams. Bring a known problem, or work with us to find the first one worth taking on.