@livekit/components-js-docs 0.1.68 → 0.1.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/generated-docs/core/createdataobserver.md +2 -1
  2. package/generated-docs/core/index.md +5 -0
  3. package/generated-docs/core/participantagentattributes.md +28 -0
  4. package/generated-docs/core/receivedagenttranscriptionmessage.md +21 -0
  5. package/generated-docs/core/receivedchatmessage.md +10 -13
  6. package/generated-docs/core/receivedmessage.md +27 -0
  7. package/generated-docs/core/receivedusertranscriptionmessage.md +21 -0
  8. package/generated-docs/core/sentmessage.md +16 -0
  9. package/generated-docs/react/agentcallbacks.md +28 -0
  10. package/generated-docs/react/agentevent.md +30 -0
  11. package/generated-docs/react/agentstate.md +14 -5
  12. package/generated-docs/react/allowaudioplaybackprops.md +4 -3
  13. package/generated-docs/react/allowaudioplaybackprops.room.md +13 -0
  14. package/generated-docs/react/barvisualizerprops.md +8 -7
  15. package/generated-docs/react/barvisualizerprops.track.md +19 -0
  16. package/generated-docs/react/barvisualizerprops.trackref.md +6 -0
  17. package/generated-docs/react/component/roomaudiorenderer.md +5 -0
  18. package/generated-docs/react/component/sessionprovider.md +24 -0
  19. package/generated-docs/react/component/startaudio.md +5 -0
  20. package/generated-docs/react/hook/useagent.md +35 -0
  21. package/generated-docs/react/hook/useensuresession.md +35 -0
  22. package/generated-docs/react/hook/useevents.md +40 -0
  23. package/generated-docs/react/hook/usemaybesessioncontext.md +30 -0
  24. package/generated-docs/react/hook/useparticipanttracks.md +2 -5
  25. package/generated-docs/react/hook/usepreviewtracks.md +1 -1
  26. package/generated-docs/react/hook/usesession.md +35 -0
  27. package/generated-docs/react/hook/usesessioncontext.md +30 -0
  28. package/generated-docs/react/hook/usesessionmessages.md +33 -0
  29. package/generated-docs/react/hook/usetracktoggle.md +5 -0
  30. package/generated-docs/react/hook/usetranscriptions.md +3 -0
  31. package/generated-docs/react/index.md +174 -151
  32. package/generated-docs/react/messagescallbacks.md +26 -0
  33. package/generated-docs/react/messagesevent.md +28 -0
  34. package/generated-docs/react/meta-data.json +1 -1
  35. package/generated-docs/react/roomaudiorendererprops.md +1 -0
  36. package/generated-docs/{core/receivedchatmessage.from.md → react/roomaudiorendererprops.room.md} +3 -3
  37. package/generated-docs/react/sessioncallbacks.md +28 -0
  38. package/generated-docs/react/sessionconnectoptions.md +31 -0
  39. package/generated-docs/react/sessionevent.md +30 -0
  40. package/generated-docs/react/sessionproviderprops.md +27 -0
  41. package/generated-docs/react/switchactivedeviceoptions.md +24 -0
  42. package/generated-docs/react/useagentreturn.md +22 -0
  43. package/generated-docs/react/usesessionmessagesreturn.md +31 -0
  44. package/generated-docs/react/usesessionreturn.md +27 -0
  45. package/generated-docs/react/usespeakingparticipantsoptions.md +18 -0
  46. package/generated-docs/react/usetextstreamoptions.md +24 -0
  47. package/generated-docs/react/usetracktoggleprops.md +6 -0
  48. package/generated-docs/react/usetracktoggleprops.room.md +13 -0
  49. package/generated-docs/react/usetranscriptionsoptions.md +1 -0
  50. package/generated-docs/react/usetranscriptionsoptions.room.md +19 -0
  51. package/package.json +2 -2
  52. package/generated-docs/core/receivedchatmessage.attributes.md +0 -13
@@ -19,7 +19,8 @@ export declare function createDataObserver(
19
19
  payload: Uint8Array<ArrayBufferLike>,
20
20
  participant?: import("livekit-client").RemoteParticipant | undefined,
21
21
  kind?: import("livekit-client").DataPacket_Kind | undefined,
22
- topic?: string | undefined
22
+ topic?: string | undefined,
23
+ encryptionType?: import("livekit-client").Encryption_Type | undefined
23
24
  ]
24
25
  >;
25
26
  ```
@@ -72,6 +72,7 @@
72
72
  | [observeParticipantMedia(participant)](./core/observeparticipantmedia.md) | |
73
73
  | [observeRoomEvents(room, events)](./core/observeroomevents.md) | |
74
74
  | [observeTrackEvents(track, events)](./core/observetrackevents.md) | |
75
+ | [ParticipantAgentAttributes](./core/participantagentattributes.md) | An enum of first party livekit attributes generated by the serverside agents sdk |
75
76
  | [participantAttributesObserver(participant)](./core/participantattributesobserver.md) | |
76
77
  | [participantAttributesObserver(participant)](./core/participantattributesobserver_1.md) | |
77
78
  | [participantByIdentifierObserver(room, { kind, identity }, options)](./core/participantbyidentifierobserver.md) | |
@@ -86,9 +87,12 @@
86
87
  | [participantTracksObservable(participant, trackIdentifier)](./core/participanttracksobservable.md) | |
87
88
  | [PIN_DEFAULT_STATE](./core/pin_default_state.md) | |
88
89
  | [PinState](./core/pinstate.md) | |
90
+ | [ReceivedAgentTranscriptionMessage](./core/receivedagenttranscriptionmessage.md) | |
89
91
  | [ReceivedChatMessage](./core/receivedchatmessage.md) | |
90
92
  | [ReceivedDataMessage](./core/receiveddatamessage.md) | |
93
+ | [ReceivedMessage](./core/receivedmessage.md) | **_(BETA)_** |
91
94
  | [ReceivedTranscriptionSegment](./core/receivedtranscriptionsegment.md) | |
95
+ | [ReceivedUserTranscriptionMessage](./core/receivedusertranscriptionmessage.md) | |
92
96
  | [recordingStatusObservable(room)](./core/recordingstatusobservable.md) | |
93
97
  | [RequireOnlyOne](./core/requireonlyone.md) | |
94
98
  | [roomAudioPlaybackAllowedObservable(room)](./core/roomaudioplaybackallowedobservable.md) | |
@@ -101,6 +105,7 @@
101
105
  | [ScreenShareTrackMap](./core/screensharetrackmap.md) | |
102
106
  | [selectGridLayout(layoutDefinitions, participantCount, width, height)](./core/selectgridlayout.md) | |
103
107
  | [sendMessage(localParticipant, payload, options)](./core/sendmessage.md) | Publish data from the LocalParticipant. |
108
+ | [SentMessage](./core/sentmessage.md) | |
104
109
  | [setDifference(setA, setB)](./core/setdifference.md) | |
105
110
  | [setLogExtension(extension, options)](./core/setlogextension.md) | Set the log extension for both the <code>@livekit/components-react</code> package and the <code>@livekit-client</code> package. To set the <code>@livekit-client</code> log extension, use the <code>liveKitClientLogExtension</code> prop on the <code>options</code> object. |
106
111
  | [setLogLevel(level, options)](./core/setloglevel.md) | Set the log level for both the <code>@livekit/components-react</code> package and the <code>@livekit-client</code> package. To set the <code>@livekit-client</code> log independently, use the <code>liveKitClientLogLevel</code> prop on the <code>options</code> object. |
@@ -0,0 +1,28 @@
1
+ ---
2
+ {
3
+ "title": "ParticipantAgentAttributes enum",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/helper/participant-attributes.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # ParticipantAgentAttributes enum
11
+
12
+ An enum of first party livekit attributes generated by the serverside agents sdk
13
+
14
+ **Signature:**
15
+
16
+ ```typescript
17
+ export declare enum ParticipantAgentAttributes
18
+ ```
19
+
20
+ ## Enumeration Members
21
+
22
+ | Member | Value | Description |
23
+ | ---------------------- | ------------------------------------------------ | ----------- |
24
+ | AgentState | <code>&quot;lk.agent.state&quot;</code> | |
25
+ | PublishOnBehalf | <code>&quot;lk.publish_on_behalf&quot;</code> | |
26
+ | TranscribedTrackId | <code>&quot;lk.transcribed_track_id&quot;</code> | |
27
+ | TranscriptionFinal | <code>&quot;lk.transcription_final&quot;</code> | |
28
+ | TranscriptionSegmentId | <code>&quot;lk.segment_id&quot;</code> | |
@@ -0,0 +1,21 @@
1
+ ---
2
+ {
3
+ "title": "ReceivedAgentTranscriptionMessage type",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/messages/types.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # ReceivedAgentTranscriptionMessage type
11
+
12
+ **Signature:**
13
+
14
+ ```typescript
15
+ export type ReceivedAgentTranscriptionMessage = ReceivedMessageWithType<
16
+ "agentTranscript",
17
+ {
18
+ message: string;
19
+ }
20
+ >;
21
+ ```
@@ -1,25 +1,22 @@
1
1
  ---
2
2
  {
3
- "title": "ReceivedChatMessage interface",
4
- "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/components/chat.ts"
3
+ "title": "ReceivedChatMessage type",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/messages/types.ts"
5
5
  }
6
6
  ---
7
7
 
8
8
  <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
9
 
10
- # ReceivedChatMessage interface
10
+ # ReceivedChatMessage type
11
11
 
12
12
  **Signature:**
13
13
 
14
14
  ```typescript
15
- export interface ReceivedChatMessage extends ChatMessage
15
+ export type ReceivedChatMessage = ReceivedMessageWithType<
16
+ "chatMessage",
17
+ ChatMessage & {
18
+ from?: Participant;
19
+ attributes?: Record<string, string>;
20
+ }
21
+ >;
16
22
  ```
17
-
18
- **Extends:** ChatMessage
19
-
20
- ## Properties
21
-
22
- | Property | Type | Description |
23
- | ------------------------------------------------------- | ---------------------------- | ------------ |
24
- | [attributes?](./core/receivedchatmessage.attributes.md) | Record&lt;string, string&gt; | _(Optional)_ |
25
- | [from?](./core/receivedchatmessage.from.md) | Participant | _(Optional)_ |
@@ -0,0 +1,27 @@
1
+ ---
2
+ {
3
+ "title": "ReceivedMessage type",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/messages/types.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # ReceivedMessage type
11
+
12
+ {% callout type="note" variation="normal" %}
13
+
14
+ This feature is under active development and may change based on developer feedback and real-world usage.
15
+
16
+ {% /callout %}
17
+
18
+ **Signature:**
19
+
20
+ ```typescript
21
+ export type ReceivedMessage =
22
+ | ReceivedUserTranscriptionMessage
23
+ | ReceivedAgentTranscriptionMessage
24
+ | ReceivedChatMessage;
25
+ ```
26
+
27
+ **References:** [ReceivedUserTranscriptionMessage](./core/receivedusertranscriptionmessage.md)<!-- -->, [ReceivedAgentTranscriptionMessage](./core/receivedagenttranscriptionmessage.md)<!-- -->, [ReceivedChatMessage](./core/receivedchatmessage.md)
@@ -0,0 +1,21 @@
1
+ ---
2
+ {
3
+ "title": "ReceivedUserTranscriptionMessage type",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/messages/types.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # ReceivedUserTranscriptionMessage type
11
+
12
+ **Signature:**
13
+
14
+ ```typescript
15
+ export type ReceivedUserTranscriptionMessage = ReceivedMessageWithType<
16
+ "userTranscript",
17
+ {
18
+ message: string;
19
+ }
20
+ >;
21
+ ```
@@ -0,0 +1,16 @@
1
+ ---
2
+ {
3
+ "title": "SentMessage type",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/messages/types.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # SentMessage type
11
+
12
+ **Signature:**
13
+
14
+ ```typescript
15
+ export type SentMessage = ChatMessage;
16
+ ```
@@ -0,0 +1,28 @@
1
+ ---
2
+ {
3
+ "title": "AgentCallbacks type",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useAgent.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # AgentCallbacks type
11
+
12
+ {% callout type="note" variation="normal" %}
13
+
14
+ This feature is under active development and may change based on developer feedback and real-world usage.
15
+
16
+ {% /callout %}
17
+
18
+ **Signature:**
19
+
20
+ ```typescript
21
+ export type AgentCallbacks = {
22
+ [AgentEvent.CameraChanged]: (newTrack: TrackReference | undefined) => void;
23
+ [AgentEvent.MicrophoneChanged]: (newTrack: TrackReference | undefined) => void;
24
+ [AgentEvent.StateChanged]: (newAgentState: AgentState) => void;
25
+ };
26
+ ```
27
+
28
+ **References:** [AgentEvent.CameraChanged](./react/agentevent.md)<!-- -->, [TrackReference](./core/trackreference.md)<!-- -->, [AgentEvent.MicrophoneChanged](./react/agentevent.md)<!-- -->, [AgentEvent.StateChanged](./react/agentevent.md)<!-- -->, [AgentState](./react/agentstate.md)
@@ -0,0 +1,30 @@
1
+ ---
2
+ {
3
+ "title": "AgentEvent enum",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useAgent.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # AgentEvent enum
11
+
12
+ {% callout type="note" variation="normal" %}
13
+
14
+ This feature is under active development and may change based on developer feedback and real-world usage.
15
+
16
+ {% /callout %}
17
+
18
+ **Signature:**
19
+
20
+ ```typescript
21
+ export declare enum AgentEvent
22
+ ```
23
+
24
+ ## Enumeration Members
25
+
26
+ | Member | Value | Description |
27
+ | ----------------- | ------------------------------------------ | ------------ |
28
+ | CameraChanged | <code>&quot;cameraChanged&quot;</code> | **_(BETA)_** |
29
+ | MicrophoneChanged | <code>&quot;microphoneChanged&quot;</code> | **_(BETA)_** |
30
+ | StateChanged | <code>&quot;stateChanged&quot;</code> | **_(BETA)_** |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  {
3
3
  "title": "AgentState type",
4
- "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useVoiceAssistant.ts"
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useAgent.ts"
5
5
  }
6
6
  ---
7
7
 
@@ -15,14 +15,23 @@ This feature is under active development and may change based on developer feedb
15
15
 
16
16
  {% /callout %}
17
17
 
18
+ State representing the current status of the agent, whether it is ready for speach, etc
19
+
20
+ For most agents (which have the preconnect audio buffer feature enabled), this is the lifecycle: connecting ➡️ pre-connect-buffering ➡️ initializing/listening/thinking/speaking
21
+
22
+ For agents without the preconnect audio feature enabled: connecting ➡️ initializing ➡️ idle/listening/thinking/speaking
23
+
24
+ If an agent fails to connect: connecting ➡️ pre-connect-buffering/initializing ➡️ failed
25
+
26
+ Legacy useVoiceAssistant hook: disconnected ➡️ connecting ➡️ initializing ➡️ listening/thinking/speaking
27
+
18
28
  **Signature:**
19
29
 
20
30
  ```typescript
21
31
  export type AgentState =
22
32
  | "disconnected"
23
33
  | "connecting"
24
- | "initializing"
25
- | "listening"
26
- | "thinking"
27
- | "speaking";
34
+ | "pre-connect-buffering"
35
+ | "failed"
36
+ | AgentSdkStates;
28
37
  ```
@@ -19,6 +19,7 @@ export interface AllowAudioPlaybackProps extends React.ButtonHTMLAttributes<HTML
19
19
 
20
20
  ## Properties
21
21
 
22
- | Property | Type | Description |
23
- | ------------------------------------------------- | ------ | ----------- |
24
- | [label](./react/allowaudioplaybackprops.label.md) | string | |
22
+ | Property | Type | Description |
23
+ | ------------------------------------------------- | ------ | ------------ |
24
+ | [label](./react/allowaudioplaybackprops.label.md) | string | |
25
+ | [room?](./react/allowaudioplaybackprops.room.md) | Room | _(Optional)_ |
@@ -0,0 +1,13 @@
1
+ ---
2
+ { "title": "AllowAudioPlaybackProps.room property" }
3
+ ---
4
+
5
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
6
+
7
+ # AllowAudioPlaybackProps.room property
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ room?: Room;
13
+ ```
@@ -25,10 +25,11 @@ export interface BarVisualizerProps extends React.HTMLProps<HTMLDivElement>
25
25
 
26
26
  ## Properties
27
27
 
28
- | Property | Type | Description |
29
- | --------------------------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
30
- | [barCount?](./react/barvisualizerprops.barcount.md) | number | **_(BETA)_** _(Optional)_ Number of bars that show up in the visualizer |
31
- | [children?](./react/barvisualizerprops.children.md) | React.ReactNode | **_(BETA)_** _(Optional)_ The template component to be used in the visualizer. |
32
- | [options?](./react/barvisualizerprops.options.md) | [BarVisualizerOptions](./react/barvisualizeroptions.md) | **_(BETA)_** _(Optional)_ |
33
- | [state?](./react/barvisualizerprops.state.md) | [AgentState](./react/agentstate.md) | **_(BETA)_** _(Optional)_ If set, the visualizer will transition between different voice assistant states |
34
- | [trackRef?](./react/barvisualizerprops.trackref.md) | [TrackReferenceOrPlaceholder](./core/trackreferenceorplaceholder.md) | **_(BETA)_** _(Optional)_ |
28
+ | Property | Type | Description |
29
+ | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
30
+ | [barCount?](./react/barvisualizerprops.barcount.md) | number | **_(BETA)_** _(Optional)_ Number of bars that show up in the visualizer |
31
+ | [children?](./react/barvisualizerprops.children.md) | React.ReactNode | **_(BETA)_** _(Optional)_ The template component to be used in the visualizer. |
32
+ | [options?](./react/barvisualizerprops.options.md) | [BarVisualizerOptions](./react/barvisualizeroptions.md) | **_(BETA)_** _(Optional)_ |
33
+ | [state?](./react/barvisualizerprops.state.md) | [AgentState](./react/agentstate.md) | **_(BETA)_** _(Optional)_ If set, the visualizer will transition between different voice assistant states |
34
+ | [track?](./react/barvisualizerprops.track.md) | [TrackReferenceOrPlaceholder](./core/trackreferenceorplaceholder.md) \| LocalAudioTrack \| RemoteAudioTrack | **_(BETA)_** _(Optional)_ |
35
+ | [trackRef?](./react/barvisualizerprops.trackref.md) | [TrackReferenceOrPlaceholder](./core/trackreferenceorplaceholder.md) | **_(BETA)_** _(Optional)_ |
@@ -0,0 +1,19 @@
1
+ ---
2
+ { "title": "BarVisualizerProps.track property" }
3
+ ---
4
+
5
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
6
+
7
+ # BarVisualizerProps.track property
8
+
9
+ {% callout type="note" variation="normal" %}
10
+
11
+ This feature is under active development and may change based on developer feedback and real-world usage.
12
+
13
+ {% /callout %}
14
+
15
+ **Signature:**
16
+
17
+ ```typescript
18
+ track?: TrackReferenceOrPlaceholder | LocalAudioTrack | RemoteAudioTrack;
19
+ ```
@@ -12,6 +12,12 @@ This feature is under active development and may change based on developer feedb
12
12
 
13
13
  {% /callout %}
14
14
 
15
+ {% callout type="caution" variation="normal" %}
16
+
17
+ This API is deprecated: use `track` field instead
18
+
19
+ {% /callout %}
20
+
15
21
  **Signature:**
16
22
 
17
23
  ```typescript
@@ -32,6 +32,11 @@ _(Optional)_ If set to `true`<!-- -->, mutes all audio tracks rendered by the co
32
32
 
33
33
  {% /parameter %}
34
34
 
35
+ {% parameter name="room" type="Room" optional=true %}
36
+ _(Optional)_
37
+
38
+ {% /parameter %}
39
+
35
40
  {% parameter name="volume" type="number" optional=true %}
36
41
  _(Optional)_ Sets the volume for all audio tracks rendered by this component. By default, the range is between `0.0` and `1.0`<!-- -->.
37
42
 
@@ -0,0 +1,24 @@
1
+ ---
2
+ {
3
+ "title": "SessionProvider",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/components/SessionProvider.tsx"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # SessionProvider
11
+
12
+ {% callout type="note" variation="normal" %}
13
+
14
+ This feature is under active development and may change based on developer feedback and real-world usage.
15
+
16
+ {% /callout %}
17
+
18
+ The `SessionProvider` component instantiates a SessionContext from the return of useSession
19
+
20
+ ## Import
21
+
22
+ ```typescript
23
+ import { SessionProvider } from "@livekit/components-react";
24
+ ```
@@ -29,3 +29,8 @@ import { StartAudio } from "@livekit/components-react";
29
29
 
30
30
  {% parameter name="label" type="string" optional=false %}
31
31
  {% /parameter %}
32
+
33
+ {% parameter name="room" type="Room" optional=true %}
34
+ _(Optional)_
35
+
36
+ {% /parameter %}
@@ -0,0 +1,35 @@
1
+ ---
2
+ {
3
+ "title": "useAgent",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useAgent.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # useAgent
11
+
12
+ {% callout type="note" variation="normal" %}
13
+
14
+ This feature is under active development and may change based on developer feedback and real-world usage.
15
+
16
+ {% /callout %}
17
+
18
+ useAgent encapculates all agent state, normalizing some quirks around how LiveKit Agents work.
19
+
20
+ ## Import
21
+
22
+ ```typescript
23
+ import { useAgent } from "@livekit/components-react";
24
+ ```
25
+
26
+ ## Properties
27
+
28
+ {% parameter name="session" type="SessionStub" optional=true %}
29
+ {% /parameter %}
30
+
31
+ ## Returns
32
+
33
+ ```typescript
34
+ UseAgentReturn;
35
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ {
3
+ "title": "useEnsureSession",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/context/session-context.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # useEnsureSession
11
+
12
+ {% callout type="note" variation="normal" %}
13
+
14
+ This feature is under active development and may change based on developer feedback and real-world usage.
15
+
16
+ {% /callout %}
17
+
18
+ Ensures that a session is provided, either via context or explicitly as a parameter. If no session is provided, an error is thrown.
19
+
20
+ ## Import
21
+
22
+ ```typescript
23
+ import { useEnsureSession } from "@livekit/components-react";
24
+ ```
25
+
26
+ ## Properties
27
+
28
+ {% parameter name="session" type="UseSessionReturn" optional=true %}
29
+ {% /parameter %}
30
+
31
+ ## Returns
32
+
33
+ ```typescript
34
+ UseSessionReturn;
35
+ ```
@@ -0,0 +1,40 @@
1
+ ---
2
+ {
3
+ "title": "useEvents",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useEvents.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # useEvents
11
+
12
+ ## Import
13
+
14
+ ```typescript
15
+ import { useEvents } from "@livekit/components-react";
16
+ ```
17
+
18
+ ## Properties
19
+
20
+ {% parameter name="event" type="Event" optional=false %}
21
+ {% /parameter %}
22
+
23
+ {% parameter name="handlerFn" type="Callback | undefined" optional=false %}
24
+ {% /parameter %}
25
+
26
+ {% parameter name="instance" type="Emitter | {
27
+ internal: {
28
+ emitter: Emitter;
29
+ };
30
+ } | null | undefined" optional=false %}
31
+ {% /parameter %}
32
+
33
+ {% parameter name="dependencies" type="React.DependencyList" optional=true %}
34
+ {% /parameter %}
35
+
36
+ ## Returns
37
+
38
+ ```typescript
39
+ void
40
+ ```
@@ -0,0 +1,30 @@
1
+ ---
2
+ {
3
+ "title": "useMaybeSessionContext",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/context/session-context.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # useMaybeSessionContext
11
+
12
+ {% callout type="note" variation="normal" %}
13
+
14
+ This feature is under active development and may change based on developer feedback and real-world usage.
15
+
16
+ {% /callout %}
17
+
18
+ Returns the session context if it exists, otherwise undefined.
19
+
20
+ ## Import
21
+
22
+ ```typescript
23
+ import { useMaybeSessionContext } from "@livekit/components-react";
24
+ ```
25
+
26
+ ## Returns
27
+
28
+ ```typescript
29
+ UseSessionReturn | undefined;
30
+ ```
@@ -19,14 +19,11 @@ import { useParticipantTracks } from "@livekit/components-react";
19
19
 
20
20
  ## Properties
21
21
 
22
- {% parameter name="sources" type="Track.Source[]" optional=false %}
23
- {% /parameter %}
24
-
25
- {% parameter name="participantIdentity" type="string" optional=true %}
22
+ {% parameter name="sources" type="Array<TrackSource>" optional=false %}
26
23
  {% /parameter %}
27
24
 
28
25
  ## Returns
29
26
 
30
27
  ```typescript
31
- TrackReference[]
28
+ Array<TrackReference>;
32
29
  ```
@@ -23,5 +23,5 @@ import { usePreviewTracks } from "@livekit/components-react";
23
23
  ## Returns
24
24
 
25
25
  ```typescript
26
- (LocalTrack < Track.Kind > []) | undefined;
26
+ (LocalAudioTrack | LocalVideoTrack)[] | undefined
27
27
  ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ {
3
+ "title": "useSession",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useSession.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # useSession
11
+
12
+ {% callout type="note" variation="normal" %}
13
+
14
+ This feature is under active development and may change based on developer feedback and real-world usage.
15
+
16
+ {% /callout %}
17
+
18
+ A Session represents a managed connection to a Room which can contain Agents.
19
+
20
+ ## Import
21
+
22
+ ```typescript
23
+ import { useSession } from "@livekit/components-react";
24
+ ```
25
+
26
+ ## Properties
27
+
28
+ {% parameter name="tokenSource" type="TokenSourceConfigurable" optional=false %}
29
+ {% /parameter %}
30
+
31
+ ## Returns
32
+
33
+ ```typescript
34
+ UseSessionReturn;
35
+ ```