Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b1bd77f
feat: add IVS transport support for real-time inference
nagar-decart Mar 4, 2026
d897ff0
feat: add IVS transport toggle to demo page
nagar-decart Mar 4, 2026
ed1829f
fix: send initial image/prompt after IVS stage join, not before
nagar-decart Mar 4, 2026
b2fb312
fix(rt): correct IVS Stage strategy callback signatures
nagar-decart Mar 4, 2026
2e8f7b2
fix(rt): remove participant arg from IVS strategy callbacks
nagar-decart Mar 4, 2026
d9a4259
chore: remove npm lock file, add to gitignore
nagar-decart Mar 4, 2026
4ef2c91
feat(demo): add IVS transport selector to react-vite example
nagar-decart Mar 4, 2026
9ec7f9e
feat(rt): add IVS viewer/subscriber support
nagar-decart Mar 5, 2026
33ffd89
fix(rt): convert wss:// to https:// for IVS subscribe HTTP fetch
nagar-decart Mar 5, 2026
eb2949c
fix(rt): filter out client camera in IVS subscribe strategy
nagar-decart Mar 8, 2026
5cb9a31
fix(rt): filter IVS subscribe by server participant ID
nagar-decart Mar 8, 2026
1856f1c
feat(rt): expose IVS stage streams for stats collection
nagar-decart Mar 8, 2026
75093c2
refactor(rt): extract StatsParser from WebRTCStatsCollector
nagar-decart Mar 8, 2026
070a2cf
feat(rt): add IVSStatsCollector for polling IVS stream stats
nagar-decart Mar 8, 2026
aca9272
feat(rt): add IVS stats collection and telemetry transport tag
nagar-decart Mar 8, 2026
9a97326
fix: export IVSStageStream and IVSLocalStageStream interfaces
nagar-decart Mar 8, 2026
47132d6
feat(rt): add E2E latency measurement (composite RTT + pixel marker)
nagar-decart Mar 8, 2026
ee13805
refactor(rt): extract LatencyDiagnostics facade from client.ts
nagar-decart Mar 9, 2026
40fd1b8
fix(rt): add audio passthrough to IVS transport
nagar-decart Mar 9, 2026
daf4674
fix(rt): reject hanging promises on IVS disconnect and cancel delayed…
nagar-decart Mar 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist
.DS_Store
packages/sdk/tests/e2e-output
.env
package-lock.json
1 change: 1 addition & 0 deletions examples/react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@aws/ivs-web-broadcast": "^1.0.0",
"@decartai/sdk": "workspace:*",
"react": "^19.0.0",
"react-dom": "^19.0.0"
Expand Down
17 changes: 16 additions & 1 deletion examples/react-vite/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { VideoStream } from "./components/VideoStream";

function App() {
const [prompt, setPrompt] = useState("anime style, vibrant colors");
const [transport, setTransport] = useState<"webrtc" | "ivs">("webrtc");

return (
<div style={{ padding: "2rem", fontFamily: "system-ui" }}>
Expand All @@ -20,7 +21,21 @@ function App() {
</label>
</div>

<VideoStream prompt={prompt} />
<div style={{ marginBottom: "1rem" }}>
<label>
Transport:
<select
value={transport}
onChange={(e) => setTransport(e.target.value as "webrtc" | "ivs")}
style={{ marginLeft: "0.5rem", padding: "0.5rem" }}
>
<option value="webrtc">WebRTC</option>
<option value="ivs">IVS</option>
</select>
</label>
</div>

<VideoStream key={transport} prompt={prompt} transport={transport} />
</div>
);
}
Expand Down
8 changes: 5 additions & 3 deletions examples/react-vite/src/components/VideoStream.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { useEffect, useRef, useState } from "react";

interface VideoStreamProps {
prompt: string;
transport?: "webrtc" | "ivs";
}

export function VideoStream({ prompt }: VideoStreamProps) {
export function VideoStream({ prompt, transport = "webrtc" }: VideoStreamProps) {
const inputRef = useRef<HTMLVideoElement>(null);
const outputRef = useRef<HTMLVideoElement>(null);
const realtimeClientRef = useRef<RealTimeClient | null>(null);
Expand Down Expand Up @@ -33,8 +34,6 @@ export function VideoStream({ prompt }: VideoStreamProps) {
inputRef.current.srcObject = stream;
}

setStatus("connecting...");

const apiKey = import.meta.env.VITE_DECART_API_KEY;
if (!apiKey) {
throw new Error("DECART_API_KEY is not set");
Expand All @@ -44,8 +43,11 @@ export function VideoStream({ prompt }: VideoStreamProps) {
apiKey,
});

setStatus(`connecting via ${transport}...`);

const realtimeClient = await client.realtime.connect(stream, {
model,
transport,
onRemoteStream: (transformedStream: MediaStream) => {
if (outputRef.current) {
outputRef.current.srcObject = transformedStream;
Expand Down
33 changes: 33 additions & 0 deletions packages/sdk/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ <h3>Configuration</h3>
<option value="lucy_2_rt">Lucy 2 RT</option>
</select>
</div>
<div class="control-group">
<label for="transport-select">Transport:</label>
<select id="transport-select">
<option value="webrtc" selected>WebRTC</option>
<option value="ivs">IVS (Interactive Video Service)</option>
</select>
</div>
<div class="control-group">
<label for="initial-prompt">Initial Prompt (empty = passthrough):</label>
<input type="text" id="initial-prompt" placeholder="e.g. Lego World">
Expand Down Expand Up @@ -377,6 +384,7 @@ <h3>Console Logs</h3>
const elements = {
apiKey: document.getElementById('api-key'),
modelSelect: document.getElementById('model-select'),
transportSelect: document.getElementById('transport-select'),
realtimeBaseUrl: document.getElementById('realtime-base-url'),
initialPrompt: document.getElementById('initial-prompt'),
startCamera: document.getElementById('start-camera'),
Expand Down Expand Up @@ -443,6 +451,27 @@ <h3>Console Logs</h3>
elements.statusText.textContent = status.charAt(0).toUpperCase() + status.slice(1);
}

// Transport selection handler — load IVS SDK from CDN when IVS is selected
let ivsScriptLoaded = false;
elements.transportSelect.addEventListener('change', (e) => {
const transport = e.target.value;
addLog(`Selected transport: ${transport}`, 'info');

if (transport === 'ivs' && !ivsScriptLoaded) {
addLog('Loading IVS Web Broadcast SDK from CDN...', 'info');
const script = document.createElement('script');
script.src = 'https://web-broadcast.live-video.net/1.14.0/amazon-ivs-web-broadcast.js';
script.onload = () => {
ivsScriptLoaded = true;
addLog('IVS Web Broadcast SDK loaded', 'success');
};
script.onerror = () => {
addLog('Failed to load IVS SDK — IVS transport will not work', 'error');
};
document.head.appendChild(script);
}
});

// Model selection handler
elements.modelSelect.addEventListener('change', (e) => {
const selectedModel = e.target.value;
Expand Down Expand Up @@ -527,8 +556,12 @@ <h3>Console Logs</h3>
initialImage = await initialImageResponse.blob();
}

const selectedTransport = elements.transportSelect.value;
addLog(`Connecting with transport: ${selectedTransport}`, 'info');

decartRealtime = await decartClient.realtime.connect(localStream, {
model,
transport: selectedTransport,
onRemoteStream: (stream) => {
addLog('Received remote stream from Decart', 'success');
elements.remoteVideo.srcObject = stream;
Expand Down
8 changes: 8 additions & 0 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,13 @@
"mitt": "^3.0.1",
"p-retry": "^6.2.1",
"zod": "^4.0.17"
},
"peerDependencies": {
"@aws/ivs-web-broadcast": ">=1.14.0"
},
"peerDependenciesMeta": {
"@aws/ivs-web-broadcast": {
"optional": true
}
}
}
2 changes: 2 additions & 0 deletions packages/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export type {
RealTimeClientConnectOptions,
RealTimeClientInitialState,
} from "./realtime/client";
export type { CompositeLatencyEstimate } from "./realtime/composite-latency";
export type { PixelLatencyMeasurement } from "./realtime/pixel-latency";
export type {
ConnectionPhase,
DiagnosticEvent,
Expand Down
Loading
Loading