APPSOCOMDocs

Engagement

Reactions, file sharing, polls, Q&A and live captions. They all work in the browser and from your backend. Hosts are people with the moderate permission (teachers), or everyone in rooms whose tokens have no role.

Reactions

ts
room.react("👍");
room.on("reaction", (emoji, from) => show(emoji, from?.name ?? "you"));

Reactions must be emoji. Each person can send about 10 every 5 seconds, and they aren't stored.

File sharing

ts
const file = await room.shareFile(input.files[0]);
room.on("file-shared", (f) => addToList(f));   // also for files shared before you joined
link.href = room.fileUrl(f.id);
await room.deleteFile(f.id);                   // your own; hosts can remove any

Files can be up to 25 MB each, with up to 100 per room. They're deleted when the room has been empty for 2 minutes. Observers can download but can't share.

Polls

ts
// hosts
room.createPoll({ question: "Which topic next?", options: ["Fractions", "Decimals"], hideResults: true });
room.closePoll(poll.id);

// everyone
room.on("poll", (poll) => render(poll, room.myVote(poll.id)));
room.vote(poll.id, 1);

Polls take 2 to 10 options, with up to 20 per room. hideResults keeps the counts from everyone but hosts until the poll closes.

Q&A

ts
room.askQuestion("Can we have more examples?", /* anonymous */ false);
room.upvoteQuestion(q.id);
room.on("question", (q) => render(q, room.hasUpvoted(q.id)));
room.markAnswered(q.id);   // hosts

Polls and questions are cleared 2 minutes after the room empties. Fetch them first if you want to keep them, with GET /rooms/:roomId/polls and GET /rooms/:roomId/questions.

Live captions, transcripts and summaries

ts
// hosts
room.setCaptions(true, { language: "en" });     // or { translate: true } for English captions of any language
const summary = await room.summarize("lesson"); // or "meeting"
const vtt = await room.getTranscript("vtt");     // "json" | "txt" | "vtt"

// everyone
room.on("caption", (line) => showCaption(line.name, line.text));

Captions arrive 1 to 3 seconds after someone stops speaking. Audio isn't stored, only the text. Tell people when captions are on (the captions event makes that easy). From your backend, use PUT /rooms/:roomId/captions, GET /rooms/:roomId/transcript?format=vtt and POST /rooms/:roomId/summary.