https://github.com/roboflow/inference-sdk-js
https://github.com/roboflow/inference-sdk-js
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/roboflow/inference-sdk-js
- Owner: roboflow
- Created: 2025-11-13T15:08:33.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2026-01-02T14:14:18.000Z (6 months ago)
- Last Synced: 2026-01-08T15:59:25.249Z (6 months ago)
- Language: TypeScript
- Size: 133 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# @roboflow/inference-sdk
Lightweight JS client for Roboflow's hosted inference API with WebRTC streaming support for real-time computer vision in the browser.
## Installation
```bash
npm install @roboflow/inference-sdk
```
## Quick Example
```typescript
import { useStream, connectors } from '@roboflow/inference-sdk';
import { useCamera } from '@roboflow/inference-sdk/streams';
const stream = await useCamera({ video: { facingMode: "environment" } });
const connection = await useStream({
source: stream,
connector: connectors.withProxyUrl('/api/init-webrtc'), // Use backend proxy
wrtcParams: { workflowSpec: { /* ... */ } },
onData: (data) => console.log("Inference results:", data)
});
const videoElement.srcObject = await connection.remoteStream();
```
See the [sample app](https://github.com/roboflow/inferenceSampleApp) for a complete working example.
## Security Warning
**Never expose your API key in frontend code.** Always use a backend proxy for production applications. The sample app demonstrates the recommended proxy pattern.
## Get Started
For a complete working example with backend proxy setup, see:
**[github.com/roboflow/inferenceSampleApp](https://github.com/roboflow/inferenceSampleApp)**
## Resources
- [Roboflow Documentation](https://docs.roboflow.com/)
- [API Authentication Guide](https://docs.roboflow.com/api-reference/authentication)
- [Workflows Documentation](https://docs.roboflow.com/workflows)
## License
See the main repository for license information.