Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c102108
feat: add IVS transport support for real-time inference
nagar-decart Mar 4, 2026
5c4d340
feat: add IVS transport toggle to demo page
nagar-decart Mar 4, 2026
e85e1b9
fix: send initial image/prompt after IVS stage join, not before
nagar-decart Mar 4, 2026
8fa7339
fix(rt): correct IVS Stage strategy callback signatures
nagar-decart Mar 4, 2026
0b82785
fix(rt): remove participant arg from IVS strategy callbacks
nagar-decart Mar 4, 2026
cf307e8
chore: remove npm lock file, add to gitignore
nagar-decart Mar 4, 2026
e2f6e5e
feat(demo): add IVS transport selector to react-vite example
nagar-decart Mar 4, 2026
a22697a
feat(rt): add IVS viewer/subscriber support
nagar-decart Mar 5, 2026
54fb7ae
fix(rt): convert wss:// to https:// for IVS subscribe HTTP fetch
nagar-decart Mar 5, 2026
2b11860
fix(rt): filter out client camera in IVS subscribe strategy
nagar-decart Mar 8, 2026
3d319eb
fix(rt): filter IVS subscribe by server participant ID
nagar-decart Mar 8, 2026
3db212e
feat(rt): expose IVS stage streams for stats collection
nagar-decart Mar 8, 2026
263996d
refactor(rt): extract StatsParser from WebRTCStatsCollector
nagar-decart Mar 8, 2026
2081fac
feat(rt): add IVSStatsCollector for polling IVS stream stats
nagar-decart Mar 8, 2026
dedacc1
feat(rt): add IVS stats collection and telemetry transport tag
nagar-decart Mar 8, 2026
cf3be33
fix: export IVSStageStream and IVSLocalStageStream interfaces
nagar-decart Mar 8, 2026
128d671
feat(rt): add E2E latency measurement (composite RTT + pixel marker)
nagar-decart Mar 8, 2026
f51f8e2
refactor(rt): extract LatencyDiagnostics facade from client.ts
nagar-decart Mar 9, 2026
5e3a5aa
fix(rt): add audio passthrough to IVS transport
nagar-decart Mar 9, 2026
ab539c2
fix(rt): reject hanging promises on IVS disconnect and cancel delayed…
nagar-decart Mar 9, 2026
b3c8131
fix(pixel-latency): increase probe TTL from 10s to 60s
nagar-decart Mar 10, 2026
650862c
feat(rt): add E2E pixel latency with canvas input frame stamper
nagar-decart Mar 10, 2026
65308db
fix(rt): start pixel stamper before connect to fix IVS video
nagar-decart Mar 11, 2026
8724412
feat(rt): expose all pixel latency outcomes to client (no survivorshi…
nagar-decart Mar 11, 2026
1eae102
feat(rt): add nackCount and nackCountDelta to WebRTC video stats
nagar-decart Mar 11, 2026
5ba032e
fix(rt): address code review findings on E2E pixel latency
nagar-decart Mar 11, 2026
8f919a3
fix: correct IVS package name to amazon-ivs-web-broadcast
nagar-decart Mar 11, 2026
cbfb66c
fix(rt): always fire pixel latency report interval + add selectedCand…
nagar-decart Mar 11, 2026
f513cf4
fix(rt): append latency_diagnostics=true to WS URL when latency track…
nagar-decart Mar 11, 2026
feca070
fix(rt): rewrite PixelLatencyStamper with Insertable Streams to prese…
nagar-decart Mar 12, 2026
6f9e11e
feat(rt): add extraQueryParams option to connect
nagar-decart Mar 12, 2026
c86cc1b
fix(rt): use z.record(z.string(), z.string()) for Zod 4
nagar-decart Mar 12, 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": {
"amazon-ivs-web-broadcast": "^1.14.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": {
"amazon-ivs-web-broadcast": ">=1.14.0"
},
"peerDependenciesMeta": {
"amazon-ivs-web-broadcast": {
"optional": true
}
}
}
8 changes: 8 additions & 0 deletions packages/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type {
RealTimeClientConnectOptions,
RealTimeClientInitialState,
} from "./realtime/client";
export type { CompositeLatencyEstimate } from "./realtime/composite-latency";
export type {
ConnectionPhase,
DiagnosticEvent,
Expand All @@ -39,6 +40,13 @@ export type {
VideoStallEvent,
} from "./realtime/diagnostics";
export type { SetInput } from "./realtime/methods";
export type {
PixelLatencyEvent,
PixelLatencyMeasurement,
PixelLatencyReport,
PixelLatencyStats,
PixelLatencyStatus,
} from "./realtime/pixel-latency";
export type {
RealTimeSubscribeClient,
SubscribeEvents,
Expand Down
Loading
Loading