A simple, easy to use react component to use Simli
npm install @simli/simli-react
import { SimliController, SimliReact, getRoomUrl } from "simli-react";
const controller = useRef<SimliController>(new SimliController());
<SimliReact controller={controller.current} />
const roomUrl = await getRoomUrl({
apiKey: YOUR_API_KEY,
faceId: "tmp9i8bbq7c",
voiceId: "f114a467-c40a-4db8-964d-aaba89cd08fa",
systemPrompt: "You are a helpful assistant",
firstMessage: "Hello, how can I help you today?",
});
controller.current.setCallbackAvatarJoined(() => {
console.log("Avatar joined");
});
await controller.current.startConnection(roomUrl);
controller.current.stopConnection();
A full example can be found at /example/simli-react-demo
Docs can be found at Docs