- a local route that starts or adopts the camera server
- a lifecycle layer that handles polling + SSE + reconnect
- component state that renders camera/session data cleanly
example_app/src/app/api/server/route.tsexample_app/src/lib/event-stream.tsexample_app/src/lib/camera-manager.tsexample_app/src/app/page.tsx
When to use
- Next.js / React apps that want to embed the server lifecycle
- Apps that should auto-discover and auto-connect cameras
- Apps that want typed action helpers without owning raw SSE parsing everywhere
When NOT to use
- Scripts or CLIs — call the SDK client directly
- Non-React apps — use the discovery/SSE recipes directly
Hook pattern
Usage
Why this matches the real app
- The browser layer starts the server through
POST /api/server, not by spawning a binary directly in client code. CameraManagerowns polling, SSE, connect timing, reconnect, and post-connect setup.- React components stay focused on state + rendering, not transport details.

