[{"data":1,"prerenderedAt":1636},["ShallowReactive",2],{"docs:/docs/high-level-sdks/stream":3},{"id":4,"title":5,"body":6,"description":17,"extension":1630,"meta":1631,"navigation":267,"path":1632,"seo":1633,"stem":1634,"__hash__":1635},"docs/docs/high-level-sdks/stream.md","Stream SDK",{"type":7,"value":8,"toc":1616},"minimark",[9,14,18,23,33,38,60,64,101,160,164,196,219,223,946,950,953,956,961,1139,1214,1218,1333,1336,1342,1436,1440,1612],[10,11,13],"h1",{"id":12},"nolagstream","@nolag/stream",[15,16,17],"p",{},"Live streaming engagement with comments, reactions, and polls.",[19,20,22],"h2",{"id":21},"overview","Overview",[15,24,25,28,29,32],{},[26,27,13],"code",{}," adds real-time viewer engagement to any live stream. Viewers can post comments, fire reaction bursts, and vote in polls, all delivered with sub-100ms latency. Broadcasters get live viewer counts, comment moderation hooks, and the ability to create and close polls on the fly. Comments are replayed on join so late arrivals see the full conversation; reactions and poll votes are ephemeral to keep things snappy. Your app owns one core NoLag client and injects it into ",[26,30,31],{},"NoLagStream","; the wrapper attaches its behaviour to that connection.",[34,35,37],"h3",{"id":36},"key-features","Key Features",[39,40,41,45,48,51,54,57],"ul",{},[42,43,44],"li",{},"Threaded comment stream with 7-day replay for late joiners",[42,46,47],{},"Ephemeral reaction bursts for fire-and-forget emoji animations",[42,49,50],{},"Live polls with real-time vote tallying and automatic close",[42,52,53],{},"Live viewer count updated as viewers join and leave",[42,55,56],{},"1-day poll result replay so viewers can see recent poll outcomes",[42,58,59],{},"Automatic reconnection with state restoration",[19,61,63],{"id":62},"how-it-works","How It Works",[15,65,66,68,69,72,73,76,77,80,81,84,85,88,89,92,93,96,97,100],{},[26,67,31],{}," attaches to an injected ",[26,70,71],{},"@nolag/js-sdk"," client and maintains a lobby for viewer counts. Calling ",[26,74,75],{},"joinStream()"," creates a ",[26,78,79],{},"StreamRoom"," that subscribes to three topics: ",[26,82,83],{},"comments"," for durable comment history, ",[26,86,87],{},"_reactions"," for ephemeral emoji bursts, and ",[26,90,91],{},"polls"," for durable poll state. A ",[26,94,95],{},"CommentStore"," accumulates comments while a ",[26,98,99],{},"PollManager"," tracks the active poll and its running vote totals. The app owns the socket lifecycle; the wrapper never opens or closes it.",[102,103,104,120],"table",{},[105,106,107],"thead",{},[108,109,110,114,117],"tr",{},[111,112,113],"th",{},"Topic",[111,115,116],{},"Purpose",[111,118,119],{},"Replay",[121,122,123,136,148],"tbody",{},[108,124,125,130,133],{},[126,127,128],"td",{},[26,129,83],{},[126,131,132],{},"Viewer comments: text, author info, timestamp",[126,134,135],{},"7 days",[108,137,138,142,145],{},[126,139,140],{},[26,141,87],{},[126,143,144],{},"Emoji reaction bursts (ephemeral)",[126,146,147],{},"None",[108,149,150,154,157],{},[126,151,152],{},[26,153,91],{},[126,155,156],{},"Poll creation, vote updates, and close events",[126,158,159],{},"1 day",[19,161,163],{"id":162},"installation","Installation",[165,166,167],"code-tabs",{},[168,169,175],"pre",{"className":170,"code":171,"filename":172,"language":173,"meta":174,"style":174},"language-bash shiki shiki-themes github-light github-dark","npm install @nolag/stream @nolag/js-sdk\n","Terminal","bash","",[26,176,177],{"__ignoreMap":174},[178,179,182,186,190,193],"span",{"class":180,"line":181},"line",1,[178,183,185],{"class":184},"sScJk","npm",[178,187,189],{"class":188},"sZZnC"," install",[178,191,192],{"class":188}," @nolag/stream",[178,194,195],{"class":188}," @nolag/js-sdk\n",[197,198,200],"note",{"title":199},"Shared connection",[15,201,202,203,206,207,210,211,214,215,218],{},"One core NoLag client can back several wrapper SDKs at once, for example stream engagement, chat, and notify on a single socket, as long as each wrapper uses a distinct ",[26,204,205],{},"appName",". Each wrapper attaches its handlers on construction and releases them with ",[26,208,209],{},"detach()",", and never touches the socket itself. Your app owns ",[26,212,213],{},"connect()"," and ",[26,216,217],{},"disconnect()",".",[19,220,222],{"id":221},"quick-start","Quick Start",[165,224,225],{},[168,226,231],{"className":227,"code":228,"filename":229,"language":230,"meta":174,"style":174},"language-typescript shiki shiki-themes github-light github-dark","import { NoLag } from '@nolag/js-sdk'\nimport { NoLagStream } from '@nolag/stream'\n\n// The app owns one core client. In a browser, pass a token provider so the\n// SDK can mint fresh short-lived client tokens from your backend.\nconst client = NoLag(async () => (await (await fetch('/api/nolag-token')).json()).token)\n\n// Inject the client into the stream wrapper (role: 'viewer', 'moderator', or 'host')\nconst stream = new NoLagStream({ client, username: 'Alice', role: 'viewer' })\n\nawait client.connect()   // the app owns the connection\nawait stream.ready()     // wrapper setup complete\n\n// Join a stream session\nconst room = await stream.joinStream('live-event-2026')\n\n// Display live viewer count\nstream.on('viewerCountChanged', ({ count }) => {\n  console.log('Viewers:', count)\n})\n\n// Send a comment\nawait room.sendComment('This is amazing!')\n\n// Listen for comments from other viewers\nroom.on('comment', (c) => {\n  console.log(`[${c.author.name}]: ${c.text}`)\n})\n\n// Send a reaction burst\nawait room.sendReaction('🔥')\n\nroom.on('reaction', ({ emoji, count }) => {\n  console.log(`${count}x ${emoji}`)\n})\n\n// Create a poll (typically broadcaster-side)\nconst poll = await room.createPoll({\n  question: 'Which feature next?',\n  options: ['Dark mode', 'Mobile app', 'API access'],\n  durationMs: 60_000,\n})\n\n// Vote on the active poll\nawait room.votePoll(poll.pollId, 1) // vote for index 1\n\nroom.on('pollUpdated', (p) => {\n  console.log('Results:', p.options.map(o => `${o.label}: ${o.votes}`))\n})\n\n// Teardown: the wrapper releases its handlers; the app closes the socket.\nstream.detach()\nclient.disconnect()\n","TypeScript","typescript",[26,232,233,249,262,269,276,282,337,342,348,379,384,401,418,423,429,455,460,466,495,512,518,523,529,547,552,558,584,623,628,633,639,656,661,689,712,717,722,728,748,760,782,793,798,803,809,830,835,857,908,913,918,924,935],{"__ignoreMap":174},[178,234,235,239,243,246],{"class":180,"line":181},[178,236,238],{"class":237},"szBVR","import",[178,240,242],{"class":241},"sVt8B"," { NoLag } ",[178,244,245],{"class":237},"from",[178,247,248],{"class":188}," '@nolag/js-sdk'\n",[178,250,252,254,257,259],{"class":180,"line":251},2,[178,253,238],{"class":237},[178,255,256],{"class":241}," { NoLagStream } ",[178,258,245],{"class":237},[178,260,261],{"class":188}," '@nolag/stream'\n",[178,263,265],{"class":180,"line":264},3,[178,266,268],{"emptyLinePlaceholder":267},true,"\n",[178,270,272],{"class":180,"line":271},4,[178,273,275],{"class":274},"sJ8bj","// The app owns one core client. In a browser, pass a token provider so the\n",[178,277,279],{"class":180,"line":278},5,[178,280,281],{"class":274},"// SDK can mint fresh short-lived client tokens from your backend.\n",[178,283,285,288,292,295,298,301,304,307,310,313,316,318,320,323,325,328,331,334],{"class":180,"line":284},6,[178,286,287],{"class":237},"const",[178,289,291],{"class":290},"sj4cs"," client",[178,293,294],{"class":237}," =",[178,296,297],{"class":184}," NoLag",[178,299,300],{"class":241},"(",[178,302,303],{"class":237},"async",[178,305,306],{"class":241}," () ",[178,308,309],{"class":237},"=>",[178,311,312],{"class":241}," (",[178,314,315],{"class":237},"await",[178,317,312],{"class":241},[178,319,315],{"class":237},[178,321,322],{"class":184}," fetch",[178,324,300],{"class":241},[178,326,327],{"class":188},"'/api/nolag-token'",[178,329,330],{"class":241},")).",[178,332,333],{"class":184},"json",[178,335,336],{"class":241},"()).token)\n",[178,338,340],{"class":180,"line":339},7,[178,341,268],{"emptyLinePlaceholder":267},[178,343,345],{"class":180,"line":344},8,[178,346,347],{"class":274},"// Inject the client into the stream wrapper (role: 'viewer', 'moderator', or 'host')\n",[178,349,351,353,356,358,361,364,367,370,373,376],{"class":180,"line":350},9,[178,352,287],{"class":237},[178,354,355],{"class":290}," stream",[178,357,294],{"class":237},[178,359,360],{"class":237}," new",[178,362,363],{"class":184}," NoLagStream",[178,365,366],{"class":241},"({ client, username: ",[178,368,369],{"class":188},"'Alice'",[178,371,372],{"class":241},", role: ",[178,374,375],{"class":188},"'viewer'",[178,377,378],{"class":241}," })\n",[178,380,382],{"class":180,"line":381},10,[178,383,268],{"emptyLinePlaceholder":267},[178,385,387,389,392,395,398],{"class":180,"line":386},11,[178,388,315],{"class":237},[178,390,391],{"class":241}," client.",[178,393,394],{"class":184},"connect",[178,396,397],{"class":241},"()   ",[178,399,400],{"class":274},"// the app owns the connection\n",[178,402,404,406,409,412,415],{"class":180,"line":403},12,[178,405,315],{"class":237},[178,407,408],{"class":241}," stream.",[178,410,411],{"class":184},"ready",[178,413,414],{"class":241},"()     ",[178,416,417],{"class":274},"// wrapper setup complete\n",[178,419,421],{"class":180,"line":420},13,[178,422,268],{"emptyLinePlaceholder":267},[178,424,426],{"class":180,"line":425},14,[178,427,428],{"class":274},"// Join a stream session\n",[178,430,432,434,437,439,442,444,447,449,452],{"class":180,"line":431},15,[178,433,287],{"class":237},[178,435,436],{"class":290}," room",[178,438,294],{"class":237},[178,440,441],{"class":237}," await",[178,443,408],{"class":241},[178,445,446],{"class":184},"joinStream",[178,448,300],{"class":241},[178,450,451],{"class":188},"'live-event-2026'",[178,453,454],{"class":241},")\n",[178,456,458],{"class":180,"line":457},16,[178,459,268],{"emptyLinePlaceholder":267},[178,461,463],{"class":180,"line":462},17,[178,464,465],{"class":274},"// Display live viewer count\n",[178,467,469,472,475,477,480,483,487,490,492],{"class":180,"line":468},18,[178,470,471],{"class":241},"stream.",[178,473,474],{"class":184},"on",[178,476,300],{"class":241},[178,478,479],{"class":188},"'viewerCountChanged'",[178,481,482],{"class":241},", ({ ",[178,484,486],{"class":485},"s4XuR","count",[178,488,489],{"class":241}," }) ",[178,491,309],{"class":237},[178,493,494],{"class":241}," {\n",[178,496,498,501,504,506,509],{"class":180,"line":497},19,[178,499,500],{"class":241},"  console.",[178,502,503],{"class":184},"log",[178,505,300],{"class":241},[178,507,508],{"class":188},"'Viewers:'",[178,510,511],{"class":241},", count)\n",[178,513,515],{"class":180,"line":514},20,[178,516,517],{"class":241},"})\n",[178,519,521],{"class":180,"line":520},21,[178,522,268],{"emptyLinePlaceholder":267},[178,524,526],{"class":180,"line":525},22,[178,527,528],{"class":274},"// Send a comment\n",[178,530,532,534,537,540,542,545],{"class":180,"line":531},23,[178,533,315],{"class":237},[178,535,536],{"class":241}," room.",[178,538,539],{"class":184},"sendComment",[178,541,300],{"class":241},[178,543,544],{"class":188},"'This is amazing!'",[178,546,454],{"class":241},[178,548,550],{"class":180,"line":549},24,[178,551,268],{"emptyLinePlaceholder":267},[178,553,555],{"class":180,"line":554},25,[178,556,557],{"class":274},"// Listen for comments from other viewers\n",[178,559,561,564,566,568,571,574,577,580,582],{"class":180,"line":560},26,[178,562,563],{"class":241},"room.",[178,565,474],{"class":184},[178,567,300],{"class":241},[178,569,570],{"class":188},"'comment'",[178,572,573],{"class":241},", (",[178,575,576],{"class":485},"c",[178,578,579],{"class":241},") ",[178,581,309],{"class":237},[178,583,494],{"class":241},[178,585,587,589,591,593,596,598,600,603,605,608,611,613,615,618,621],{"class":180,"line":586},27,[178,588,500],{"class":241},[178,590,503],{"class":184},[178,592,300],{"class":241},[178,594,595],{"class":188},"`[${",[178,597,576],{"class":241},[178,599,218],{"class":188},[178,601,602],{"class":241},"author",[178,604,218],{"class":188},[178,606,607],{"class":241},"name",[178,609,610],{"class":188},"}]: ${",[178,612,576],{"class":241},[178,614,218],{"class":188},[178,616,617],{"class":241},"text",[178,619,620],{"class":188},"}`",[178,622,454],{"class":241},[178,624,626],{"class":180,"line":625},28,[178,627,517],{"class":241},[178,629,631],{"class":180,"line":630},29,[178,632,268],{"emptyLinePlaceholder":267},[178,634,636],{"class":180,"line":635},30,[178,637,638],{"class":274},"// Send a reaction burst\n",[178,640,642,644,646,649,651,654],{"class":180,"line":641},31,[178,643,315],{"class":237},[178,645,536],{"class":241},[178,647,648],{"class":184},"sendReaction",[178,650,300],{"class":241},[178,652,653],{"class":188},"'🔥'",[178,655,454],{"class":241},[178,657,659],{"class":180,"line":658},32,[178,660,268],{"emptyLinePlaceholder":267},[178,662,664,666,668,670,673,675,678,681,683,685,687],{"class":180,"line":663},33,[178,665,563],{"class":241},[178,667,474],{"class":184},[178,669,300],{"class":241},[178,671,672],{"class":188},"'reaction'",[178,674,482],{"class":241},[178,676,677],{"class":485},"emoji",[178,679,680],{"class":241},", ",[178,682,486],{"class":485},[178,684,489],{"class":241},[178,686,309],{"class":237},[178,688,494],{"class":241},[178,690,692,694,696,698,701,703,706,708,710],{"class":180,"line":691},34,[178,693,500],{"class":241},[178,695,503],{"class":184},[178,697,300],{"class":241},[178,699,700],{"class":188},"`${",[178,702,486],{"class":241},[178,704,705],{"class":188},"}x ${",[178,707,677],{"class":241},[178,709,620],{"class":188},[178,711,454],{"class":241},[178,713,715],{"class":180,"line":714},35,[178,716,517],{"class":241},[178,718,720],{"class":180,"line":719},36,[178,721,268],{"emptyLinePlaceholder":267},[178,723,725],{"class":180,"line":724},37,[178,726,727],{"class":274},"// Create a poll (typically broadcaster-side)\n",[178,729,731,733,736,738,740,742,745],{"class":180,"line":730},38,[178,732,287],{"class":237},[178,734,735],{"class":290}," poll",[178,737,294],{"class":237},[178,739,441],{"class":237},[178,741,536],{"class":241},[178,743,744],{"class":184},"createPoll",[178,746,747],{"class":241},"({\n",[178,749,751,754,757],{"class":180,"line":750},39,[178,752,753],{"class":241},"  question: ",[178,755,756],{"class":188},"'Which feature next?'",[178,758,759],{"class":241},",\n",[178,761,763,766,769,771,774,776,779],{"class":180,"line":762},40,[178,764,765],{"class":241},"  options: [",[178,767,768],{"class":188},"'Dark mode'",[178,770,680],{"class":241},[178,772,773],{"class":188},"'Mobile app'",[178,775,680],{"class":241},[178,777,778],{"class":188},"'API access'",[178,780,781],{"class":241},"],\n",[178,783,785,788,791],{"class":180,"line":784},41,[178,786,787],{"class":241},"  durationMs: ",[178,789,790],{"class":290},"60_000",[178,792,759],{"class":241},[178,794,796],{"class":180,"line":795},42,[178,797,517],{"class":241},[178,799,801],{"class":180,"line":800},43,[178,802,268],{"emptyLinePlaceholder":267},[178,804,806],{"class":180,"line":805},44,[178,807,808],{"class":274},"// Vote on the active poll\n",[178,810,812,814,816,819,822,825,827],{"class":180,"line":811},45,[178,813,315],{"class":237},[178,815,536],{"class":241},[178,817,818],{"class":184},"votePoll",[178,820,821],{"class":241},"(poll.pollId, ",[178,823,824],{"class":290},"1",[178,826,579],{"class":241},[178,828,829],{"class":274},"// vote for index 1\n",[178,831,833],{"class":180,"line":832},46,[178,834,268],{"emptyLinePlaceholder":267},[178,836,838,840,842,844,847,849,851,853,855],{"class":180,"line":837},47,[178,839,563],{"class":241},[178,841,474],{"class":184},[178,843,300],{"class":241},[178,845,846],{"class":188},"'pollUpdated'",[178,848,573],{"class":241},[178,850,15],{"class":485},[178,852,579],{"class":241},[178,854,309],{"class":237},[178,856,494],{"class":241},[178,858,860,862,864,866,869,872,875,877,880,883,886,888,890,893,896,898,900,903,905],{"class":180,"line":859},48,[178,861,500],{"class":241},[178,863,503],{"class":184},[178,865,300],{"class":241},[178,867,868],{"class":188},"'Results:'",[178,870,871],{"class":241},", p.options.",[178,873,874],{"class":184},"map",[178,876,300],{"class":241},[178,878,879],{"class":485},"o",[178,881,882],{"class":237}," =>",[178,884,885],{"class":188}," `${",[178,887,879],{"class":241},[178,889,218],{"class":188},[178,891,892],{"class":241},"label",[178,894,895],{"class":188},"}: ${",[178,897,879],{"class":241},[178,899,218],{"class":188},[178,901,902],{"class":241},"votes",[178,904,620],{"class":188},[178,906,907],{"class":241},"))\n",[178,909,911],{"class":180,"line":910},49,[178,912,517],{"class":241},[178,914,916],{"class":180,"line":915},50,[178,917,268],{"emptyLinePlaceholder":267},[178,919,921],{"class":180,"line":920},51,[178,922,923],{"class":274},"// Teardown: the wrapper releases its handlers; the app closes the socket.\n",[178,925,927,929,932],{"class":180,"line":926},52,[178,928,471],{"class":241},[178,930,931],{"class":184},"detach",[178,933,934],{"class":241},"()\n",[178,936,938,941,944],{"class":180,"line":937},53,[178,939,940],{"class":241},"client.",[178,942,943],{"class":184},"disconnect",[178,945,934],{"class":241},[19,947,949],{"id":948},"api-reference","API Reference",[34,951,31],{"id":952},"nolagstream-1",[15,954,955],{},"The main class. Attaches to the injected core client, manages lobby viewer counts, and the stream room lifecycle.",[957,958,960],"h4",{"id":959},"constructor-options","Constructor Options",[102,962,963,976],{},[105,964,965],{},[108,966,967,970,973],{},[111,968,969],{},"Option",[111,971,972],{},"Type",[111,974,975],{},"Description",[121,977,978,997,1014,1028,1046,1061,1077,1092,1107,1121],{},[108,979,980,985,990],{},[126,981,982],{},[26,983,984],{},"client",[126,986,987],{},[26,988,989],{},"NoLagSocket",[126,991,992,996],{},[993,994,995],"strong",{},"Required."," The injected core NoLag client the app owns and connects.",[108,998,999,1004,1009],{},[126,1000,1001],{},[26,1002,1003],{},"username",[126,1005,1006],{},[26,1007,1008],{},"string",[126,1010,1011,1013],{},[993,1012,995],{}," Display name for this viewer.",[108,1015,1016,1021,1025],{},[126,1017,1018],{},[26,1019,1020],{},"avatar",[126,1022,1023],{},[26,1024,1008],{},[126,1026,1027],{},"Optional avatar URL.",[108,1029,1030,1035,1040],{},[126,1031,1032],{},[26,1033,1034],{},"role",[126,1036,1037],{},[26,1038,1039],{},"'viewer' | 'moderator' | 'host'",[126,1041,1042,1043,1045],{},"Viewer role (default ",[26,1044,375],{},").",[108,1047,1048,1053,1058],{},[126,1049,1050],{},[26,1051,1052],{},"metadata",[126,1054,1055],{},[26,1056,1057],{},"Record\u003Cstring, unknown>",[126,1059,1060],{},"Optional custom data attached to viewer presence.",[108,1062,1063,1067,1071],{},[126,1064,1065],{},[26,1066,205],{},[126,1068,1069],{},[26,1070,1008],{},[126,1072,1073,1074,1045],{},"NoLag app for topic prefixes (default ",[26,1075,1076],{},"'stream'",[108,1078,1079,1084,1089],{},[126,1080,1081],{},[26,1082,1083],{},"streams",[126,1085,1086],{},[26,1087,1088],{},"string[]",[126,1090,1091],{},"Streams to join once the wrapper is ready.",[108,1093,1094,1099,1104],{},[126,1095,1096],{},[26,1097,1098],{},"maxCommentCache",[126,1100,1101],{},[26,1102,1103],{},"number",[126,1105,1106],{},"Max comments kept in memory per stream.",[108,1108,1109,1114,1118],{},[126,1110,1111],{},[26,1112,1113],{},"reactionWindow",[126,1115,1116],{},[26,1117,1103],{},[126,1119,1120],{},"Reaction burst aggregation window in ms.",[108,1122,1123,1128,1133],{},[126,1124,1125],{},[26,1126,1127],{},"debug",[126,1129,1130],{},[26,1131,1132],{},"boolean",[126,1134,1135,1136,1045],{},"Enable wrapper debug logging (default ",[26,1137,1138],{},"false",[102,1140,1141,1150],{},[105,1142,1143],{},[108,1144,1145,1148],{},[111,1146,1147],{},"Method / Property",[111,1149,975],{},[121,1151,1152,1162,1171,1184,1194,1204],{},[108,1153,1154,1159],{},[126,1155,1156],{},[26,1157,1158],{},"ready()",[126,1160,1161],{},"Resolves once wrapper setup completed",[108,1163,1164,1168],{},[126,1165,1166],{},[26,1167,209],{},[126,1169,1170],{},"Release this wrapper's handlers and topics; terminal, never closes the socket",[108,1172,1173,1178],{},[126,1174,1175],{},[26,1176,1177],{},"joinStream(name)",[126,1179,1180,1181,1183],{},"Join a live stream session; returns a ",[26,1182,79],{}," instance",[108,1185,1186,1191],{},[126,1187,1188],{},[26,1189,1190],{},"leaveStream(name)",[126,1192,1193],{},"Leave a stream and unsubscribe from its topics",[108,1195,1196,1201],{},[126,1197,1198],{},[26,1199,1200],{},"getOnlineViewers()",[126,1202,1203],{},"Return all viewers currently online across all joined streams",[108,1205,1206,1211],{},[126,1207,1208],{},[26,1209,1210],{},"viewerCount",[126,1212,1213],{},"Reactive property with the current total viewer count across all joined streams",[34,1215,1217],{"id":1216},"events-nolagstream","Events: NoLagStream",[102,1219,1220,1232],{},[105,1221,1222],{},[108,1223,1224,1227,1230],{},[111,1225,1226],{},"Event",[111,1228,1229],{},"Payload",[111,1231,975],{},[121,1233,1234,1247,1262,1274,1289,1304,1318],{},[108,1235,1236,1241,1244],{},[126,1237,1238],{},[26,1239,1240],{},"connected",[126,1242,1243],{},"none",[126,1245,1246],{},"WebSocket connection established",[108,1248,1249,1254,1259],{},[126,1250,1251],{},[26,1252,1253],{},"disconnected",[126,1255,1256],{},[26,1257,1258],{},"reason: string",[126,1260,1261],{},"Connection closed",[108,1263,1264,1269,1271],{},[126,1265,1266],{},[26,1267,1268],{},"reconnected",[126,1270,1243],{},[126,1272,1273],{},"Reconnection successful; streams are restored automatically",[108,1275,1276,1281,1286],{},[126,1277,1278],{},[26,1279,1280],{},"error",[126,1282,1283],{},[26,1284,1285],{},"error: Error",[126,1287,1288],{},"Unrecoverable error occurred",[108,1290,1291,1296,1301],{},[126,1292,1293],{},[26,1294,1295],{},"viewerOnline",[126,1297,1298],{},[26,1299,1300],{},"viewer: StreamViewer",[126,1302,1303],{},"A viewer joined any stream",[108,1305,1306,1311,1315],{},[126,1307,1308],{},[26,1309,1310],{},"viewerOffline",[126,1312,1313],{},[26,1314,1300],{},[126,1316,1317],{},"A viewer left any stream",[108,1319,1320,1325,1330],{},[126,1321,1322],{},[26,1323,1324],{},"viewerCountChanged",[126,1326,1327],{},[26,1328,1329],{},"{ count: number }",[126,1331,1332],{},"Total viewer count changed",[34,1334,79],{"id":1335},"streamroom",[15,1337,1338,1339,1341],{},"Returned by ",[26,1340,75],{},". Handles comments, reactions, polls, and per-stream viewer presence.",[102,1343,1344,1352],{},[105,1345,1346],{},[108,1347,1348,1350],{},[111,1349,1147],{},[111,1351,975],{},[121,1353,1354,1364,1374,1384,1394,1404,1413,1427],{},[108,1355,1356,1361],{},[126,1357,1358],{},[26,1359,1360],{},"sendComment(text)",[126,1362,1363],{},"Publish a comment to this stream",[108,1365,1366,1371],{},[126,1367,1368],{},[26,1369,1370],{},"sendReaction(emoji)",[126,1372,1373],{},"Fire an ephemeral reaction burst to all viewers",[108,1375,1376,1381],{},[126,1377,1378],{},[26,1379,1380],{},"createPoll(opts)",[126,1382,1383],{},"Create a new poll with a question, options array, and optional duration",[108,1385,1386,1391],{},[126,1387,1388],{},[26,1389,1390],{},"votePoll(pollId, optionIndex)",[126,1392,1393],{},"Submit a vote for an option by its zero-based index",[108,1395,1396,1401],{},[126,1397,1398],{},[26,1399,1400],{},"closePoll(pollId)",[126,1402,1403],{},"Close the poll early and broadcast final results",[108,1405,1406,1410],{},[126,1407,1408],{},[26,1409,83],{},[126,1411,1412],{},"Reactive array of all comments in the local store",[108,1414,1415,1420],{},[126,1416,1417],{},[26,1418,1419],{},"activePoll",[126,1421,1422,1423,1426],{},"The currently open poll, or ",[26,1424,1425],{},"null"," if none",[108,1428,1429,1433],{},[126,1430,1431],{},[26,1432,1210],{},[126,1434,1435],{},"Number of viewers currently in this stream room",[34,1437,1439],{"id":1438},"events-streamroom","Events: StreamRoom",[102,1441,1442,1452],{},[105,1443,1444],{},[108,1445,1446,1448,1450],{},[111,1447,1226],{},[111,1449,1229],{},[111,1451,975],{},[121,1453,1454,1469,1483,1498,1513,1527,1541,1556,1570,1583,1597],{},[108,1455,1456,1461,1466],{},[126,1457,1458],{},[26,1459,1460],{},"comment",[126,1462,1463],{},[26,1464,1465],{},"StreamComment",[126,1467,1468],{},"A comment arrived from another viewer",[108,1470,1471,1476,1480],{},[126,1472,1473],{},[26,1474,1475],{},"commentSent",[126,1477,1478],{},[26,1479,1465],{},[126,1481,1482],{},"Confirmation that your own comment was delivered",[108,1484,1485,1490,1495],{},[126,1486,1487],{},[26,1488,1489],{},"reaction",[126,1491,1492],{},[26,1493,1494],{},"{ emoji: string, count: number }",[126,1496,1497],{},"A reaction burst arrived; animate accordingly",[108,1499,1500,1505,1510],{},[126,1501,1502],{},[26,1503,1504],{},"pollCreated",[126,1506,1507],{},[26,1508,1509],{},"StreamPoll",[126,1511,1512],{},"A new poll was opened",[108,1514,1515,1520,1524],{},[126,1516,1517],{},[26,1518,1519],{},"pollUpdated",[126,1521,1522],{},[26,1523,1509],{},[126,1525,1526],{},"Vote tallies updated",[108,1528,1529,1534,1538],{},[126,1530,1531],{},[26,1532,1533],{},"pollClosed",[126,1535,1536],{},[26,1537,1509],{},[126,1539,1540],{},"Poll closed with final results",[108,1542,1543,1548,1553],{},[126,1544,1545],{},[26,1546,1547],{},"viewerJoined",[126,1549,1550],{},[26,1551,1552],{},"StreamViewer",[126,1554,1555],{},"A viewer joined this stream room",[108,1557,1558,1563,1567],{},[126,1559,1560],{},[26,1561,1562],{},"viewerLeft",[126,1564,1565],{},[26,1566,1552],{},[126,1568,1569],{},"A viewer left this stream room",[108,1571,1572,1576,1580],{},[126,1573,1574],{},[26,1575,1324],{},[126,1577,1578],{},[26,1579,1329],{},[126,1581,1582],{},"Viewer count for this stream changed",[108,1584,1585,1590,1594],{},[126,1586,1587],{},[26,1588,1589],{},"replayStart",[126,1591,1592],{},[26,1593,1329],{},[126,1595,1596],{},"Historical comment replay is beginning",[108,1598,1599,1604,1609],{},[126,1600,1601],{},[26,1602,1603],{},"replayEnd",[126,1605,1606],{},[26,1607,1608],{},"{ replayed: number }",[126,1610,1611],{},"Historical comment replay is complete",[1613,1614,1615],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":174,"searchDepth":251,"depth":251,"links":1617},[1618,1621,1622,1623,1624],{"id":21,"depth":251,"text":22,"children":1619},[1620],{"id":36,"depth":264,"text":37},{"id":62,"depth":251,"text":63},{"id":162,"depth":251,"text":163},{"id":221,"depth":251,"text":222},{"id":948,"depth":251,"text":949,"children":1625},[1626,1627,1628,1629],{"id":952,"depth":264,"text":31},{"id":1216,"depth":264,"text":1217},{"id":1335,"depth":264,"text":79},{"id":1438,"depth":264,"text":1439},"md",{},"/docs/high-level-sdks/stream",{"title":5,"description":17},"docs/high-level-sdks/stream","r7QdK8gQ1TYIDI0TSLjbY4OttxZ1arU00S0zFu_Jvdk",1788160344043]