Skip to main content
Reactor makes working with, and using Realtime AI a breeze. Build powerful Realtime AI applications in only minutes, and scale them globally leveraging our world-class GPU cloud. Our SDKs and platform are built for application developers: Reactor comes with all the tools you need to write revolutionary Realtime AI applications, but without the overhead of having to maintain a Realtime AI streaming stack of your own.

Example Usage

import { Reactor, fetchInsecureJwtToken } from "@reactor-team/js-sdk";

// Authenticate
const jwtToken = await fetchInsecureJwtToken(apiKey);

// Create instance
const reactor = new Reactor({
  modelName: "livecore",
});

// Set up video display
reactor.on("streamChanged", (videoTrack) => {
  if (videoTrack) {
    const stream = new MediaStream([videoTrack]);
    document.getElementById("video").srcObject = stream;
  }
});

// Connect to the model
await reactor.connect(jwtToken);

// Send commands
await reactor.sendCommand("schedule_prompt", { 
  new_prompt: "A sunset over the ocean", 
  timestamp: 0 
});
await reactor.sendCommand("start", {});