diff --git a/api/fishjam-server b/api/fishjam-server index 4d7c5508..2a8c6e20 160000 --- a/api/fishjam-server +++ b/api/fishjam-server @@ -1 +1 @@ -Subproject commit 4d7c550873599856cece48d95be58b8636016dbd +Subproject commit 2a8c6e20cd551f8ba9528b92903820327331a076 diff --git a/api/protos b/api/protos index 1ff0f980..2aaaf19d 160000 --- a/api/protos +++ b/api/protos @@ -1 +1 @@ -Subproject commit 1ff0f9806c53da1d29be98e14d31096cdabeffef +Subproject commit 2aaaf19da7bc4a86c4ef491152bea06e66f3c6dd diff --git a/packages/python-server-sdk b/packages/python-server-sdk index fb05c3cb..3435babc 160000 --- a/packages/python-server-sdk +++ b/packages/python-server-sdk @@ -1 +1 @@ -Subproject commit fb05c3cb78450e442ecd683e679e0d3654ac7f1d +Subproject commit 3435babcc1034dd203ca0dec71c785d54ae37f2f diff --git a/packages/web-client-sdk b/packages/web-client-sdk index 52dcce8e..d78484b4 160000 --- a/packages/web-client-sdk +++ b/packages/web-client-sdk @@ -1 +1 @@ -Subproject commit 52dcce8e5d9028b4b4a64ceba99c1e70db0838ed +Subproject commit d78484b4f189e2789ab2da373043d6e3c10800de diff --git a/static/api/protobuf/agent_notifications.proto b/static/api/protobuf/agent_notifications.proto index c54c7bec..2be78962 100644 --- a/static/api/protobuf/agent_notifications.proto +++ b/static/api/protobuf/agent_notifications.proto @@ -44,12 +44,17 @@ message AgentRequest { string track_id = 1; } + message CaptureImage { + string track_id = 1; + } + oneof content { AuthRequest auth_request = 1; AddTrack add_track = 2; RemoveTrack remove_track = 3; TrackData track_data = 4; InterruptTrack interrupt_track = 5; + CaptureImage capture_image = 6; } } @@ -65,8 +70,15 @@ message AgentResponse { bytes data = 3; } + message TrackImage { + string track_id = 1; + string content_type = 2; + bytes data = 3; + } + oneof content { Authenticated authenticated = 1; TrackData track_data = 2; + TrackImage track_image = 3; } } diff --git a/static/api/protobuf/server_notifications.proto b/static/api/protobuf/server_notifications.proto index 75ae6a88..c833974d 100644 --- a/static/api/protobuf/server_notifications.proto +++ b/static/api/protobuf/server_notifications.proto @@ -74,7 +74,7 @@ message ServerMessage { EVENT_TYPE_SERVER_NOTIFICATION = 1; } - // Request sent by peer to subsribe for certain message type + // Request sent by peer to subscribe for certain message type message SubscribeRequest { EventType event_type = 1; } @@ -100,7 +100,7 @@ message ServerMessage { string component_id = 2; } - // Notification sent when the HLS recording is successfully uploded to AWS S3 + // Notification sent when the HLS recording is successfully uploaded to AWS S3 message HlsUploaded { string room_id = 1; } @@ -148,6 +148,26 @@ message ServerMessage { notifications.Track track = 4; } + // Notification sent when a peer creates a channel + message ChannelAdded { + string room_id = 1; + oneof endpoint_info { + string peer_id = 2; + string component_id = 3; + } + string channel_id = 4; + } + + // Notification sent when a peer deletes a channel + message ChannelRemoved { + string room_id = 1; + oneof endpoint_info { + string peer_id = 2; + string component_id = 3; + } + string channel_id = 4; + } + // Notification sent when streamer successfully connects message StreamConnected { string stream_id = 1; @@ -209,5 +229,7 @@ message ServerMessage { ViewerDisconnected viewer_disconnected = 25; StreamerConnected streamer_connected = 26; StreamerDisconnected streamer_disconnected = 27; + ChannelAdded channel_added = 28; + ChannelRemoved channel_removed = 29; } } diff --git a/versioned_docs/version-0.25.0/_common/agents/definition.mdx b/versioned_docs/version-0.25.0/_common/agents/definition.mdx new file mode 100644 index 00000000..c6de7300 --- /dev/null +++ b/versioned_docs/version-0.25.0/_common/agents/definition.mdx @@ -0,0 +1,6 @@ +## What is an Agent? + +An agent is a piece of software that allows your backend server to participate in a Fishjam room, similar to how the Fishjam client SDKs allow your client-side application to participate in a Fishjam room. +They can be used to implement features such as real-time audio transcription, real-time content moderation, conversations with AI agents and more. + +You can simply think of an agent as a peer running within your backend application. diff --git a/versioned_docs/version-0.25.0/_common/agents/remember-to-disconnect.mdx b/versioned_docs/version-0.25.0/_common/agents/remember-to-disconnect.mdx new file mode 100644 index 00000000..4960eed1 --- /dev/null +++ b/versioned_docs/version-0.25.0/_common/agents/remember-to-disconnect.mdx @@ -0,0 +1,3 @@ +:::danger Remember to disconnect your agents! +It's important to disconnect agents, because **every connected agent generates usage** just as a normal peer. +::: diff --git a/versioned_docs/version-0.25.0/_common/agents/subscriptions.mdx b/versioned_docs/version-0.25.0/_common/agents/subscriptions.mdx new file mode 100644 index 00000000..f4aaa318 --- /dev/null +++ b/versioned_docs/version-0.25.0/_common/agents/subscriptions.mdx @@ -0,0 +1,4 @@ +By default, agents **won't** receive peers' audio streams. +This is by design and aims to prevent unnecessary resource usage by the agents. + +For an agent to start receiving a peer's audio, the peer must be **created** with the **subscribe** option set. diff --git a/versioned_docs/version-0.25.0/api/_category_.json b/versioned_docs/version-0.25.0/api/_category_.json new file mode 100644 index 00000000..24fd9392 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/_category_.json @@ -0,0 +1,12 @@ +{ + "label": "API", + "position": 6, + "link": { + "type": "generated-index", + "description": "API documentation for Client and Server SDKs.", + "slug": "/api" + }, + "customProps": { + "id": "generated-api" + } +} diff --git a/versioned_docs/version-0.25.0/api/mobile/enumerations/Variant.md b/versioned_docs/version-0.25.0/api/mobile/enumerations/Variant.md new file mode 100644 index 00000000..e4dca4f1 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/enumerations/Variant.md @@ -0,0 +1,43 @@ +# Enumeration: Variant + +Defined in: packages/ts-client/dist/index.d.mts:18 + +## Enumeration Members + +### UNRECOGNIZED + +> **UNRECOGNIZED**: `-1` + +Defined in: packages/ts-client/dist/index.d.mts:23 + +*** + +### VARIANT\_HIGH + +> **VARIANT\_HIGH**: `3` + +Defined in: packages/ts-client/dist/index.d.mts:22 + +*** + +### VARIANT\_LOW + +> **VARIANT\_LOW**: `1` + +Defined in: packages/ts-client/dist/index.d.mts:20 + +*** + +### VARIANT\_MEDIUM + +> **VARIANT\_MEDIUM**: `2` + +Defined in: packages/ts-client/dist/index.d.mts:21 + +*** + +### VARIANT\_UNSPECIFIED + +> **VARIANT\_UNSPECIFIED**: `0` + +Defined in: packages/ts-client/dist/index.d.mts:19 diff --git a/versioned_docs/version-0.25.0/api/mobile/functions/FishjamProvider.md b/versioned_docs/version-0.25.0/api/mobile/functions/FishjamProvider.md new file mode 100644 index 00000000..e58c63dd --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/functions/FishjamProvider.md @@ -0,0 +1,15 @@ +# Function: FishjamProvider() + +> **FishjamProvider**(`props`): `FunctionComponentElement`\<`FishjamProviderProps`\> + +Defined in: [packages/mobile-client/src/index.ts:91](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/index.ts#L91) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `props` | [`FishjamProviderProps`](../type-aliases/FishjamProviderProps.md) | + +## Returns + +`FunctionComponentElement`\<`FishjamProviderProps`\> diff --git a/versioned_docs/version-0.25.0/api/mobile/functions/RTCPIPView.md b/versioned_docs/version-0.25.0/api/mobile/functions/RTCPIPView.md new file mode 100644 index 00000000..ff20dfd8 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/functions/RTCPIPView.md @@ -0,0 +1,15 @@ +# Function: RTCPIPView() + +> **RTCPIPView**(`__namedParameters`): `Element` + +Defined in: [packages/mobile-client/src/overrides/RTCView.tsx:32](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/overrides/RTCView.tsx#L32) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `__namedParameters` | [`RTCPIPViewProps`](../type-aliases/RTCPIPViewProps.md) | + +## Returns + +`Element` diff --git a/versioned_docs/version-0.25.0/api/mobile/functions/RTCView.md b/versioned_docs/version-0.25.0/api/mobile/functions/RTCView.md new file mode 100644 index 00000000..860e63c1 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/functions/RTCView.md @@ -0,0 +1,15 @@ +# Function: RTCView() + +> **RTCView**(`__namedParameters`): `Element` + +Defined in: [packages/mobile-client/src/overrides/RTCView.tsx:27](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/overrides/RTCView.tsx#L27) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `__namedParameters` | [`RTCVideoViewProps`](../type-aliases/RTCVideoViewProps.md) | + +## Returns + +`Element` diff --git a/versioned_docs/version-0.25.0/api/mobile/functions/useCamera.md b/versioned_docs/version-0.25.0/api/mobile/functions/useCamera.md new file mode 100644 index 00000000..f79844dd --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/functions/useCamera.md @@ -0,0 +1,122 @@ +# Function: useCamera() + +> **useCamera**(): `object` + +Defined in: packages/react-client/dist/hooks/devices/useCamera.d.ts:5 + +This hook can toggle camera on/off, change camera, provides current camera and other. + +## Returns + +### ~~activeCamera~~ + +> **activeCamera**: `null` \| [`DeviceItem`](../type-aliases/DeviceItem.md) + +#### Deprecated + +Use `currentCamera` and `isCameraOn` instead +Indicates which camera is now turned on and streaming + +### cameraDeviceError + +> **cameraDeviceError**: `null` \| [`DeviceError`](../type-aliases/DeviceError.md) + +Possible error thrown while setting up the camera + +### cameraDevices + +> **cameraDevices**: [`DeviceItem`](../type-aliases/DeviceItem.md)[] + +List of available camera devices + +### cameraStream + +> **cameraStream**: `null` \| `MediaStream` + +The MediaStream object containing the current stream + +### currentCamera + +> **currentCamera**: `null` \| `MediaDeviceInfo` + +Indicates which camera is now selected + +### currentCameraMiddleware + +> **currentCameraMiddleware**: [`TrackMiddleware`](../type-aliases/TrackMiddleware.md) + +The currently set camera middleware function + +### isCameraOn + +> **isCameraOn**: `boolean` + +Indicates whether the camera is streaming video + +### selectCamera() + +> **selectCamera**: (`deviceId`) => `Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> + +Selects the camera device + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `deviceId` | `string` | + +#### Returns + +`Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> + +### setCameraTrackMiddleware() + +> **setCameraTrackMiddleware**: (`middleware`) => `Promise`\<`void`\> + +Sets the camera middleware + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `middleware` | [`TrackMiddleware`](../type-aliases/TrackMiddleware.md) | + +#### Returns + +`Promise`\<`void`\> + +### startCamera() + +> **startCamera**: (`deviceId?`) => `Promise`\<\[`MediaStreamTrack`, `null`\] \| \[`null`, [`DeviceError`](../type-aliases/DeviceError.md)\]\> + +Starts the camera + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `deviceId?` | `null` \| `string` | + +#### Returns + +`Promise`\<\[`MediaStreamTrack`, `null`\] \| \[`null`, [`DeviceError`](../type-aliases/DeviceError.md)\]\> + +### stopCamera() + +> **stopCamera**: () => `void` + +Stops the camera + +#### Returns + +`void` + +### toggleCamera() + +> **toggleCamera**: () => `Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> + +Toggles current camera on/off + +#### Returns + +`Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> diff --git a/versioned_docs/version-0.25.0/api/mobile/functions/useConnection.md b/versioned_docs/version-0.25.0/api/mobile/functions/useConnection.md new file mode 100644 index 00000000..0d2b4d8f --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/functions/useConnection.md @@ -0,0 +1,53 @@ +# Function: useConnection() + +> **useConnection**(): `object` + +Defined in: packages/react-client/dist/hooks/useConnection.d.ts:17 + +Hook allows to join or leave a room and check the current connection status. + +## Returns + +### joinRoom() + +> **joinRoom**: \<`PeerMetadata`\>(`__namedParameters`) => `Promise`\<`void`\> + +Join room and start streaming camera and microphone + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `PeerMetadata` *extends* `GenericMetadata` | `GenericMetadata` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `__namedParameters` | [`JoinRoomConfig`](../interfaces/JoinRoomConfig.md)\<`PeerMetadata`\> | + +#### Returns + +`Promise`\<`void`\> + +### leaveRoom() + +> **leaveRoom**: () => `void` + +Leave room and stop streaming + +#### Returns + +`void` + +### peerStatus + +> **peerStatus**: [`PeerStatus`](../type-aliases/PeerStatus.md) + +Current peer connection status + +### reconnectionStatus + +> **reconnectionStatus**: [`ReconnectionStatus`](../type-aliases/ReconnectionStatus.md) + +Current reconnection status diff --git a/versioned_docs/version-0.25.0/api/mobile/functions/useCustomSource.md b/versioned_docs/version-0.25.0/api/mobile/functions/useCustomSource.md new file mode 100644 index 00000000..264d43a5 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/functions/useCustomSource.md @@ -0,0 +1,44 @@ +# Function: useCustomSource() + +> **useCustomSource**\<`T`\>(`sourceId`): `object` + +Defined in: packages/react-client/dist/hooks/useCustomSource.d.ts:5 + +This hook can register/deregister a custom MediaStream with Fishjam. + +## Type Parameters + +| Type Parameter | +| ------ | +| `T` *extends* `string` | + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `sourceId` | `T` | + +## Returns + +### setStream() + +> **setStream**: (`newStream`) => `Promise`\<`void`\> + +Associates the given stream with the custom source. +This stream will be sent to Fishjam after startStreaming has been called. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `newStream` | `null` \| `MediaStream` | + +#### Returns + +`Promise`\<`void`\> + +### stream + +> **stream**: `undefined` \| `MediaStream` + +The MediaStream currently associated with the custom source diff --git a/versioned_docs/version-0.25.0/api/mobile/functions/usePeers.md b/versioned_docs/version-0.25.0/api/mobile/functions/usePeers.md new file mode 100644 index 00000000..56c2afb6 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/functions/usePeers.md @@ -0,0 +1,39 @@ +# Function: usePeers() + +> **usePeers**\<`PeerMetadata`, `ServerMetadata`\>(): `object` + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:27 + +Hook allows to access id, tracks and metadata of the local and remote peers. + +## Type Parameters + +| Type Parameter | Default type | Description | +| ------ | ------ | ------ | +| `PeerMetadata` | `Record`\<`string`, `unknown`\> | Type of metadata set by peer while connecting to a room. | +| `ServerMetadata` | `Record`\<`string`, `unknown`\> | Type of metadata set by the server while creating a peer. | + +## Returns + +### localPeer + +> **localPeer**: `null` \| [`PeerWithTracks`](../type-aliases/PeerWithTracks.md)\<`PeerMetadata`, `ServerMetadata`\> + +The local peer with distinguished tracks (camera, microphone, screen share). +Will be null if the local peer is not found. + +### ~~peers~~ + +> **peers**: [`PeerWithTracks`](../type-aliases/PeerWithTracks.md)\<`PeerMetadata`, `ServerMetadata`\>[] + +#### Deprecated + +Use remotePeers instead +Legacy array containing remote peers. +This property will be removed in future versions. + +### remotePeers + +> **remotePeers**: [`PeerWithTracks`](../type-aliases/PeerWithTracks.md)\<`PeerMetadata`, `ServerMetadata`\>[] + +Array of remote peers with distinguished tracks (camera, microphone, screen share). diff --git a/versioned_docs/version-0.25.0/api/mobile/index.md b/versioned_docs/version-0.25.0/api/mobile/index.md new file mode 100644 index 00000000..ca3322b8 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/index.md @@ -0,0 +1,72 @@ +# @fishjam-cloud/react-native-client + +## Connection + +- [useConnection](functions/useConnection.md) +- [usePeers](functions/usePeers.md) +- [Metadata](type-aliases/Metadata.md) +- [useUpdatePeerMetadata](variables/useUpdatePeerMetadata.md) +- [useVAD](variables/useVAD.md) + +## Devices + +- [useCamera](functions/useCamera.md) +- [useInitializeDevices](variables/useInitializeDevices.md) +- [useScreenShare](variables/useScreenShare.md) + +## Livestream + +- [UseLivestreamStreamerResult](interfaces/UseLivestreamStreamerResult.md) +- [UseLivestreamViewerResult](interfaces/UseLivestreamViewerResult.md) +- [ConnectStreamerConfig](type-aliases/ConnectStreamerConfig.md) +- [StreamerInputs](type-aliases/StreamerInputs.md) +- [useLivestreamStreamer](variables/useLivestreamStreamer.md) +- [useLivestreamViewer](variables/useLivestreamViewer.md) + +## Other + +- [FishjamProvider](functions/FishjamProvider.md) +- [RTCPIPView](functions/RTCPIPView.md) +- [RTCView](functions/RTCView.md) +- [useCustomSource](functions/useCustomSource.md) +- [Variant](enumerations/Variant.md) +- [JoinRoomConfig](interfaces/JoinRoomConfig.md) +- [SimulcastConfig](interfaces/SimulcastConfig.md) +- [AuthErrorReason](type-aliases/AuthErrorReason.md) +- [BandwidthLimits](type-aliases/BandwidthLimits.md) +- [Brand](type-aliases/Brand.md) +- [ConnectViewerConfig](type-aliases/ConnectViewerConfig.md) +- [CustomSource](type-aliases/CustomSource.md) +- [DeviceError](type-aliases/DeviceError.md) +- [DeviceItem](type-aliases/DeviceItem.md) +- [FishjamProviderProps](type-aliases/FishjamProviderProps.md) +- [ForegroundServiceConfig](type-aliases/ForegroundServiceConfig.md) +- [InitializeDevicesResult](type-aliases/InitializeDevicesResult.md) +- [InitializeDevicesSettings](type-aliases/InitializeDevicesSettings.md) +- [InitializeDevicesStatus](type-aliases/InitializeDevicesStatus.md) +- [JoinErrorReason](type-aliases/JoinErrorReason.md) +- [MiddlewareResult](type-aliases/MiddlewareResult.md) +- [PeerId](type-aliases/PeerId.md) +- [PeerStatus](type-aliases/PeerStatus.md) +- [PeerWithTracks](type-aliases/PeerWithTracks.md) +- [PersistLastDeviceHandlers](type-aliases/PersistLastDeviceHandlers.md) +- [ReconnectConfig](type-aliases/ReconnectConfig.md) +- [ReconnectionStatus](type-aliases/ReconnectionStatus.md) +- [RoomType](type-aliases/RoomType.md) +- [RTCPIPViewProps](type-aliases/RTCPIPViewProps.md) +- [RTCVideoViewProps](type-aliases/RTCVideoViewProps.md) +- [SimulcastBandwidthLimit](type-aliases/SimulcastBandwidthLimit.md) +- [SimulcastBandwidthLimits](type-aliases/SimulcastBandwidthLimits.md) +- [StreamConfig](type-aliases/StreamConfig.md) +- [Track](type-aliases/Track.md) +- [TrackBandwidthLimit](type-aliases/TrackBandwidthLimit.md) +- [TrackId](type-aliases/TrackId.md) +- [TrackMiddleware](type-aliases/TrackMiddleware.md) +- [TracksMiddleware](type-aliases/TracksMiddleware.md) +- [TracksMiddlewareResult](type-aliases/TracksMiddlewareResult.md) +- [UseInitializeDevicesParams](type-aliases/UseInitializeDevicesParams.md) +- [UseSandboxProps](type-aliases/UseSandboxProps.md) +- [SimulcastConfig](variables/SimulcastConfig.md) +- [useForegroundService](variables/useForegroundService.md) +- [useMicrophone](variables/useMicrophone.md) +- [useSandbox](variables/useSandbox.md) diff --git a/versioned_docs/version-0.25.0/api/mobile/interfaces/JoinRoomConfig.md b/versioned_docs/version-0.25.0/api/mobile/interfaces/JoinRoomConfig.md new file mode 100644 index 00000000..230755f8 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/interfaces/JoinRoomConfig.md @@ -0,0 +1,29 @@ +# Interface: JoinRoomConfig\ + +Defined in: packages/react-client/dist/hooks/useConnection.d.ts:2 + +## Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `PeerMetadata` *extends* `GenericMetadata` | `GenericMetadata` | + +## Properties + +### peerMetadata? + +> `optional` **peerMetadata**: `PeerMetadata` + +Defined in: packages/react-client/dist/hooks/useConnection.d.ts:10 + +String indexed record with metadata, that will be available to all other peers + +*** + +### peerToken + +> **peerToken**: `string` + +Defined in: packages/react-client/dist/hooks/useConnection.d.ts:6 + +Token received from server (or Room Manager) diff --git a/versioned_docs/version-0.25.0/api/mobile/interfaces/SimulcastConfig.md b/versioned_docs/version-0.25.0/api/mobile/interfaces/SimulcastConfig.md new file mode 100644 index 00000000..c90f98c4 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/interfaces/SimulcastConfig.md @@ -0,0 +1,27 @@ +# Interface: SimulcastConfig + +Defined in: packages/ts-client/dist/index.d.mts:164 + +## Properties + +### disabledVariants + +> **disabledVariants**: [`Variant`](../enumerations/Variant.md)[] + +Defined in: packages/ts-client/dist/index.d.mts:167 + +*** + +### enabled + +> **enabled**: `boolean` + +Defined in: packages/ts-client/dist/index.d.mts:165 + +*** + +### enabledVariants + +> **enabledVariants**: [`Variant`](../enumerations/Variant.md)[] + +Defined in: packages/ts-client/dist/index.d.mts:166 diff --git a/versioned_docs/version-0.25.0/api/mobile/interfaces/UseLivestreamStreamerResult.md b/versioned_docs/version-0.25.0/api/mobile/interfaces/UseLivestreamStreamerResult.md new file mode 100644 index 00000000..dc68bdc7 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/interfaces/UseLivestreamStreamerResult.md @@ -0,0 +1,62 @@ +# Interface: UseLivestreamStreamerResult + +Defined in: packages/react-client/dist/hooks/useLivestreamStreamer.d.ts:19 + +## Properties + +### connect() + +> **connect**: (`inputs`, `urlOverride?`) => `Promise`\<`void`\> + +Defined in: packages/react-client/dist/hooks/useLivestreamStreamer.d.ts:26 + +Callback used to start publishing the selected audio and video media streams. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `inputs` | [`ConnectStreamerConfig`](../type-aliases/ConnectStreamerConfig.md) | +| `urlOverride?` | `string` | + +#### Returns + +`Promise`\<`void`\> + +#### Remarks + +Calling [connect](#connect) multiple times will have the effect of only publishing the **last** specified inputs. + +*** + +### disconnect() + +> **disconnect**: () => `void` + +Defined in: packages/react-client/dist/hooks/useLivestreamStreamer.d.ts:28 + +Callback to stop publishing anything previously published with [connect](#connect) + +#### Returns + +`void` + +*** + +### error + +> **error**: `null` \| `LivestreamError` + +Defined in: packages/react-client/dist/hooks/useLivestreamStreamer.d.ts:30 + +Any errors encountered in [connect](#connect) will populate this field + +*** + +### isConnected + +> **isConnected**: `boolean` + +Defined in: packages/react-client/dist/hooks/useLivestreamStreamer.d.ts:32 + +Utility flag which indicates the current connection status diff --git a/versioned_docs/version-0.25.0/api/mobile/interfaces/UseLivestreamViewerResult.md b/versioned_docs/version-0.25.0/api/mobile/interfaces/UseLivestreamViewerResult.md new file mode 100644 index 00000000..584d4dd2 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/interfaces/UseLivestreamViewerResult.md @@ -0,0 +1,70 @@ +# Interface: UseLivestreamViewerResult + +Defined in: packages/react-client/dist/hooks/useLivestreamViewer.d.ts:12 + +## Properties + +### connect() + +> **connect**: (`config`, `url?`) => `Promise`\<`void`\> + +Defined in: packages/react-client/dist/hooks/useLivestreamViewer.d.ts:20 + +Callback to start receiving a livestream. +If the livestream is private, provide `token`. +If the livestream is public, provide `streamId`. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`ConnectViewerConfig`](../type-aliases/ConnectViewerConfig.md) | +| `url?` | `string` | + +#### Returns + +`Promise`\<`void`\> + +*** + +### disconnect() + +> **disconnect**: () => `void` + +Defined in: packages/react-client/dist/hooks/useLivestreamViewer.d.ts:22 + +Callback used to disconnect from a stream previously connected to with [connect](#connect) + +#### Returns + +`void` + +*** + +### error + +> **error**: `null` \| `LivestreamError` + +Defined in: packages/react-client/dist/hooks/useLivestreamViewer.d.ts:24 + +Any errors encountered in [connect](#connect) will be present in this field. + +*** + +### isConnected + +> **isConnected**: `boolean` + +Defined in: packages/react-client/dist/hooks/useLivestreamViewer.d.ts:26 + +Utility flag which indicates the current connection status + +*** + +### stream + +> **stream**: `null` \| `MediaStream` + +Defined in: packages/react-client/dist/hooks/useLivestreamViewer.d.ts:14 + +The received livestream media diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/AuthErrorReason.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/AuthErrorReason.md new file mode 100644 index 00000000..5d7ef8f5 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/AuthErrorReason.md @@ -0,0 +1,5 @@ +# Type Alias: AuthErrorReason + +> **AuthErrorReason** = *typeof* `AUTH_ERROR_REASONS`\[`number`\] + +Defined in: packages/ts-client/dist/index.d.mts:5 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/BandwidthLimits.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/BandwidthLimits.md new file mode 100644 index 00000000..460f8eec --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/BandwidthLimits.md @@ -0,0 +1,21 @@ +# Type Alias: BandwidthLimits + +> **BandwidthLimits** = `object` + +Defined in: packages/react-client/dist/types/public.d.ts:57 + +## Properties + +### simulcast + +> **simulcast**: [`SimulcastBandwidthLimits`](SimulcastBandwidthLimits.md) + +Defined in: packages/react-client/dist/types/public.d.ts:59 + +*** + +### singleStream + +> **singleStream**: `number` + +Defined in: packages/react-client/dist/types/public.d.ts:58 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/Brand.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/Brand.md new file mode 100644 index 00000000..a7e8874b --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/Brand.md @@ -0,0 +1,18 @@ +# Type Alias: Brand\ + +> **Brand**\<`T`, `TBrand`\> = `T` & `object` + +Defined in: packages/react-client/dist/types/public.d.ts:72 + +## Type declaration + +### \[brand\] + +> **\[brand\]**: `TBrand` + +## Type Parameters + +| Type Parameter | +| ------ | +| `T` | +| `TBrand` *extends* `string` | diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/ConnectStreamerConfig.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/ConnectStreamerConfig.md new file mode 100644 index 00000000..3b02c3c3 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/ConnectStreamerConfig.md @@ -0,0 +1,23 @@ +# Type Alias: ConnectStreamerConfig + +> **ConnectStreamerConfig** = `object` + +Defined in: packages/react-client/dist/hooks/useLivestreamStreamer.d.ts:13 + +## Properties + +### inputs + +> **inputs**: [`StreamerInputs`](StreamerInputs.md) + +Defined in: packages/react-client/dist/hooks/useLivestreamStreamer.d.ts:14 + +*** + +### token + +> **token**: `string` + +Defined in: packages/react-client/dist/hooks/useLivestreamStreamer.d.ts:16 + +Streamer token used to authenticate with Fishjam diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/ConnectViewerConfig.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/ConnectViewerConfig.md new file mode 100644 index 00000000..09c7fa34 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/ConnectViewerConfig.md @@ -0,0 +1,5 @@ +# Type Alias: ConnectViewerConfig + +> **ConnectViewerConfig** = \{ `streamId?`: `never`; `token`: `string`; \} \| \{ `streamId`: `string`; `token?`: `never`; \} + +Defined in: packages/react-client/dist/hooks/useLivestreamViewer.d.ts:2 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/CustomSource.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/CustomSource.md new file mode 100644 index 00000000..d60a69ec --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/CustomSource.md @@ -0,0 +1,40 @@ +# Type Alias: CustomSource\ + +> **CustomSource**\<`T`\> = `object` + +Defined in: packages/react-client/dist/types/public.d.ts:75 + +## Type Parameters + +| Type Parameter | +| ------ | +| `T` *extends* `string` | + +## Properties + +### id + +> **id**: `T` + +Defined in: packages/react-client/dist/types/public.d.ts:76 + +*** + +### stream? + +> `optional` **stream**: `MediaStream` + +Defined in: packages/react-client/dist/types/public.d.ts:81 + +*** + +### trackIds? + +> `optional` **trackIds**: `object` + +Defined in: packages/react-client/dist/types/public.d.ts:77 + +| Name | Type | +| ------ | ------ | +| `audioId?` | `string` | +| `videoId?` | `string` | diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/DeviceError.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/DeviceError.md new file mode 100644 index 00000000..ff549261 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/DeviceError.md @@ -0,0 +1,5 @@ +# Type Alias: DeviceError + +> **DeviceError** = \{ `name`: `"OverconstrainedError"`; \} \| \{ `name`: `"NotAllowedError"`; \} \| \{ `name`: `"NotFoundError"`; \} \| \{ `name`: `"UNHANDLED_ERROR"`; \} + +Defined in: packages/react-client/dist/types/public.d.ts:62 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/DeviceItem.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/DeviceItem.md new file mode 100644 index 00000000..1bae9cb4 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/DeviceItem.md @@ -0,0 +1,21 @@ +# Type Alias: DeviceItem + +> **DeviceItem** = `object` + +Defined in: packages/react-client/dist/types/public.d.ts:41 + +## Properties + +### deviceId + +> **deviceId**: `string` + +Defined in: packages/react-client/dist/types/public.d.ts:42 + +*** + +### label + +> **label**: `string` + +Defined in: packages/react-client/dist/types/public.d.ts:43 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/FishjamProviderProps.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/FishjamProviderProps.md new file mode 100644 index 00000000..b523bc9e --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/FishjamProviderProps.md @@ -0,0 +1,5 @@ +# Type Alias: FishjamProviderProps + +> **FishjamProviderProps** = `Omit`\<`ReactClientFishjamProviderProps`, `"persistLastDevice"` \| `"fishjamClient"`\> + +Defined in: [packages/mobile-client/src/index.ts:90](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/index.ts#L90) diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/ForegroundServiceConfig.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/ForegroundServiceConfig.md new file mode 100644 index 00000000..0e8f40a6 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/ForegroundServiceConfig.md @@ -0,0 +1,79 @@ +# Type Alias: ForegroundServiceConfig + +> **ForegroundServiceConfig** = `object` + +Defined in: [packages/mobile-client/src/useForegroundService.ts:8](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/useForegroundService.ts#L8) + +Configuration options for foreground service permissions. + +A type representing the configuration for foreground service permissions. + +## Properties + +### channelId? + +> `optional` **channelId**: `string` + +Defined in: [packages/mobile-client/src/useForegroundService.ts:24](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/useForegroundService.ts#L24) + +The id of the channel. Must be unique per package. + +*** + +### channelName? + +> `optional` **channelName**: `string` + +Defined in: [packages/mobile-client/src/useForegroundService.ts:28](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/useForegroundService.ts#L28) + +The user visible name of the channel. + +*** + +### enableCamera? + +> `optional` **enableCamera**: `boolean` + +Defined in: [packages/mobile-client/src/useForegroundService.ts:12](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/useForegroundService.ts#L12) + +Indicates whether the camera is enabled for the foreground service. + +*** + +### enableMicrophone? + +> `optional` **enableMicrophone**: `boolean` + +Defined in: [packages/mobile-client/src/useForegroundService.ts:16](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/useForegroundService.ts#L16) + +Indicates whether the microphone is enabled for the foreground service. + +*** + +### enableScreenSharing? + +> `optional` **enableScreenSharing**: `boolean` + +Defined in: [packages/mobile-client/src/useForegroundService.ts:20](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/useForegroundService.ts#L20) + +Indicates whether screen sharing is enabled for the foreground service. + +*** + +### notificationContent? + +> `optional` **notificationContent**: `string` + +Defined in: [packages/mobile-client/src/useForegroundService.ts:36](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/useForegroundService.ts#L36) + +The text (second row) of the notification, in a standard notification. + +*** + +### notificationTitle? + +> `optional` **notificationTitle**: `string` + +Defined in: [packages/mobile-client/src/useForegroundService.ts:32](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/useForegroundService.ts#L32) + +The title (first row) of the notification, in a standard notification. diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/InitializeDevicesResult.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/InitializeDevicesResult.md new file mode 100644 index 00000000..3d7ba66a --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/InitializeDevicesResult.md @@ -0,0 +1,29 @@ +# Type Alias: InitializeDevicesResult + +> **InitializeDevicesResult** = `object` + +Defined in: packages/react-client/dist/types/public.d.ts:3 + +## Properties + +### errors + +> **errors**: \{ `audio`: [`DeviceError`](DeviceError.md) \| `null`; `video`: [`DeviceError`](DeviceError.md) \| `null`; \} \| `null` + +Defined in: packages/react-client/dist/types/public.d.ts:6 + +*** + +### status + +> **status**: [`InitializeDevicesStatus`](InitializeDevicesStatus.md) + +Defined in: packages/react-client/dist/types/public.d.ts:4 + +*** + +### stream + +> **stream**: `MediaStream` \| `null` + +Defined in: packages/react-client/dist/types/public.d.ts:5 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/InitializeDevicesSettings.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/InitializeDevicesSettings.md new file mode 100644 index 00000000..f85d28a2 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/InitializeDevicesSettings.md @@ -0,0 +1,21 @@ +# Type Alias: InitializeDevicesSettings + +> **InitializeDevicesSettings** = `object` + +Defined in: packages/react-client/dist/hooks/internal/devices/useMediaDevices.d.ts:9 + +## Properties + +### enableAudio? + +> `optional` **enableAudio**: `boolean` + +Defined in: packages/react-client/dist/hooks/internal/devices/useMediaDevices.d.ts:11 + +*** + +### enableVideo? + +> `optional` **enableVideo**: `boolean` + +Defined in: packages/react-client/dist/hooks/internal/devices/useMediaDevices.d.ts:10 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/InitializeDevicesStatus.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/InitializeDevicesStatus.md new file mode 100644 index 00000000..b3efe444 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/InitializeDevicesStatus.md @@ -0,0 +1,5 @@ +# Type Alias: InitializeDevicesStatus + +> **InitializeDevicesStatus** = `"initialized"` \| `"failed"` \| `"initialized_with_errors"` \| `"already_initialized"` + +Defined in: packages/react-client/dist/types/public.d.ts:2 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/JoinErrorReason.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/JoinErrorReason.md new file mode 100644 index 00000000..9aa3ef48 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/JoinErrorReason.md @@ -0,0 +1,5 @@ +# Type Alias: JoinErrorReason + +> **JoinErrorReason** = *typeof* `JOIN_ERRORS`\[`number`\] + +Defined in: packages/ts-client/dist/index.d.mts:888 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/Metadata.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/Metadata.md new file mode 100644 index 00000000..02c5da21 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/Metadata.md @@ -0,0 +1,28 @@ +# Type Alias: Metadata\ + +> **Metadata**\<`PeerMetadata`, `ServerMetadata`\> = `object` + +Defined in: packages/ts-client/dist/index.d.mts:911 + +## Type Parameters + +| Type Parameter | Default type | Description | +| ------ | ------ | ------ | +| `PeerMetadata` | `GenericMetadata` | Type of metadata set by peer while connecting to a room. | +| `ServerMetadata` | `GenericMetadata` | Type of metadata set by the server while creating a peer. | + +## Properties + +### peer + +> **peer**: `PeerMetadata` + +Defined in: packages/ts-client/dist/index.d.mts:912 + +*** + +### server + +> **server**: `ServerMetadata` + +Defined in: packages/ts-client/dist/index.d.mts:913 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/MiddlewareResult.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/MiddlewareResult.md new file mode 100644 index 00000000..c49e7c45 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/MiddlewareResult.md @@ -0,0 +1,25 @@ +# Type Alias: MiddlewareResult + +> **MiddlewareResult** = `object` + +Defined in: packages/react-client/dist/types/public.d.ts:21 + +## Properties + +### onClear()? + +> `optional` **onClear**: () => `void` + +Defined in: packages/react-client/dist/types/public.d.ts:23 + +#### Returns + +`void` + +*** + +### track + +> **track**: `MediaStreamTrack` + +Defined in: packages/react-client/dist/types/public.d.ts:22 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/PeerId.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/PeerId.md new file mode 100644 index 00000000..2fc229ef --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/PeerId.md @@ -0,0 +1,5 @@ +# Type Alias: PeerId + +> **PeerId** = [`Brand`](Brand.md)\<`string`, `"PeerId"`\> + +Defined in: packages/react-client/dist/types/public.d.ts:12 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/PeerStatus.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/PeerStatus.md new file mode 100644 index 00000000..529549b7 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/PeerStatus.md @@ -0,0 +1,12 @@ +# Type Alias: PeerStatus + +> **PeerStatus** = `"connecting"` \| `"connected"` \| `"error"` \| `"idle"` + +Defined in: packages/react-client/dist/types/public.d.ts:40 + +Represents the possible statuses of a peer connection. + +- `idle` - Peer is not connected, either never connected or successfully disconnected. +- `connecting` - Peer is in the process of connecting. +- `connected` - Peer has successfully connected. +- `error` - There was an error in the connection process. diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/PeerWithTracks.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/PeerWithTracks.md new file mode 100644 index 00000000..689c6f1d --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/PeerWithTracks.md @@ -0,0 +1,84 @@ +# Type Alias: PeerWithTracks\ + +> **PeerWithTracks**\<`PeerMetadata`, `ServerMetadata`\> = `object` + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:8 + +## Type Parameters + +| Type Parameter | Description | +| ------ | ------ | +| `PeerMetadata` | Type of metadata set by peer while connecting to a room. | +| `ServerMetadata` | Type of metadata set by the server while creating a peer. | + +## Properties + +### cameraTrack? + +> `optional` **cameraTrack**: [`Track`](Track.md) + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:12 + +*** + +### customAudioTracks + +> **customAudioTracks**: [`Track`](Track.md)[] + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:17 + +*** + +### customVideoTracks + +> **customVideoTracks**: [`Track`](Track.md)[] + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:16 + +*** + +### id + +> **id**: [`PeerId`](PeerId.md) + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:9 + +*** + +### metadata? + +> `optional` **metadata**: [`Metadata`](Metadata.md)\<`PeerMetadata`, `ServerMetadata`\> + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:10 + +*** + +### microphoneTrack? + +> `optional` **microphoneTrack**: [`Track`](Track.md) + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:13 + +*** + +### screenShareAudioTrack? + +> `optional` **screenShareAudioTrack**: [`Track`](Track.md) + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:15 + +*** + +### screenShareVideoTrack? + +> `optional` **screenShareVideoTrack**: [`Track`](Track.md) + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:14 + +*** + +### tracks + +> **tracks**: [`Track`](Track.md)[] + +Defined in: packages/react-client/dist/hooks/usePeers.d.ts:11 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/PersistLastDeviceHandlers.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/PersistLastDeviceHandlers.md new file mode 100644 index 00000000..e59dbfc7 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/PersistLastDeviceHandlers.md @@ -0,0 +1,42 @@ +# Type Alias: PersistLastDeviceHandlers + +> **PersistLastDeviceHandlers** = `object` + +Defined in: packages/react-client/dist/types/public.d.ts:45 + +## Properties + +### getLastDevice() + +> **getLastDevice**: (`deviceType`) => `MediaDeviceInfo` \| `null` + +Defined in: packages/react-client/dist/types/public.d.ts:46 + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `deviceType` | `"audio"` \| `"video"` | + +#### Returns + +`MediaDeviceInfo` \| `null` + +*** + +### saveLastDevice() + +> **saveLastDevice**: (`info`, `deviceType`) => `void` + +Defined in: packages/react-client/dist/types/public.d.ts:47 + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `info` | `MediaDeviceInfo` | +| `deviceType` | `"audio"` \| `"video"` | + +#### Returns + +`void` diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/RTCPIPViewProps.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/RTCPIPViewProps.md new file mode 100644 index 00000000..b2c90bd3 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/RTCPIPViewProps.md @@ -0,0 +1,11 @@ +# Type Alias: RTCPIPViewProps + +> **RTCPIPViewProps** = `Omit`\<`React.ComponentPropsWithRef`\<*typeof* `OriginalRTCPIPView`\>, `"streamURL"`\> & `object` + +Defined in: [packages/mobile-client/src/overrides/RTCView.tsx:10](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/overrides/RTCView.tsx#L10) + +## Type declaration + +### mediaStream + +> **mediaStream**: `MediaStream` diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/RTCVideoViewProps.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/RTCVideoViewProps.md new file mode 100644 index 00000000..ebf32abf --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/RTCVideoViewProps.md @@ -0,0 +1,11 @@ +# Type Alias: RTCVideoViewProps + +> **RTCVideoViewProps** = `Omit`\<`React.ComponentPropsWithRef`\<*typeof* `OriginalRTCView`\>, `"streamURL"`\> & `object` + +Defined in: [packages/mobile-client/src/overrides/RTCView.tsx:6](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/overrides/RTCView.tsx#L6) + +## Type declaration + +### mediaStream + +> **mediaStream**: `MediaStream` diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/ReconnectConfig.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/ReconnectConfig.md new file mode 100644 index 00000000..f9f0d582 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/ReconnectConfig.md @@ -0,0 +1,37 @@ +# Type Alias: ReconnectConfig + +> **ReconnectConfig** = `object` + +Defined in: packages/ts-client/dist/index.d.mts:892 + +## Properties + +### addTracksOnReconnect? + +> `optional` **addTracksOnReconnect**: `boolean` + +Defined in: packages/ts-client/dist/index.d.mts:896 + +*** + +### delay? + +> `optional` **delay**: `number` + +Defined in: packages/ts-client/dist/index.d.mts:895 + +*** + +### initialDelay? + +> `optional` **initialDelay**: `number` + +Defined in: packages/ts-client/dist/index.d.mts:894 + +*** + +### maxAttempts? + +> `optional` **maxAttempts**: `number` + +Defined in: packages/ts-client/dist/index.d.mts:893 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/ReconnectionStatus.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/ReconnectionStatus.md new file mode 100644 index 00000000..31a20591 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/ReconnectionStatus.md @@ -0,0 +1,5 @@ +# Type Alias: ReconnectionStatus + +> **ReconnectionStatus** = `"reconnecting"` \| `"idle"` \| `"error"` + +Defined in: packages/ts-client/dist/index.d.mts:891 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/RoomType.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/RoomType.md new file mode 100644 index 00000000..3b87f487 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/RoomType.md @@ -0,0 +1,5 @@ +# Type Alias: RoomType + +> **RoomType** = `"conference"` \| `"livestream"` \| `"audio_only"` + +Defined in: packages/react-client/dist/hooks/useSandbox.d.ts:6 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/SimulcastBandwidthLimit.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/SimulcastBandwidthLimit.md new file mode 100644 index 00000000..c77a88aa --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/SimulcastBandwidthLimit.md @@ -0,0 +1,9 @@ +# Type Alias: SimulcastBandwidthLimit + +> **SimulcastBandwidthLimit** = `Map`\<[`Variant`](../enumerations/Variant.md), `BandwidthLimit`\> + +Defined in: packages/ts-client/dist/index.d.mts:219 + +Type describing bandwidth limit for simulcast track. +It is a mapping (encoding => BandwidthLimit). +If encoding isn't present in this mapping, it will be assumed that this particular encoding shouldn't have any bandwidth limit diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/SimulcastBandwidthLimits.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/SimulcastBandwidthLimits.md new file mode 100644 index 00000000..98ab4575 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/SimulcastBandwidthLimits.md @@ -0,0 +1,29 @@ +# Type Alias: SimulcastBandwidthLimits + +> **SimulcastBandwidthLimits** = `object` + +Defined in: packages/react-client/dist/types/public.d.ts:49 + +## Properties + +### 1 + +> **1**: `number` + +Defined in: packages/react-client/dist/types/public.d.ts:50 + +*** + +### 2 + +> **2**: `number` + +Defined in: packages/react-client/dist/types/public.d.ts:51 + +*** + +### 3 + +> **3**: `number` + +Defined in: packages/react-client/dist/types/public.d.ts:52 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/StreamConfig.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/StreamConfig.md new file mode 100644 index 00000000..49af6ae8 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/StreamConfig.md @@ -0,0 +1,13 @@ +# Type Alias: StreamConfig + +> **StreamConfig** = `object` + +Defined in: packages/react-client/dist/types/public.d.ts:54 + +## Properties + +### simulcast? + +> `optional` **simulcast**: [`Variant`](../enumerations/Variant.md)[] \| `false` + +Defined in: packages/react-client/dist/types/public.d.ts:55 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/StreamerInputs.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/StreamerInputs.md new file mode 100644 index 00000000..caa66284 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/StreamerInputs.md @@ -0,0 +1,31 @@ +# Type Alias: StreamerInputs + +> **StreamerInputs** = \{ `audio?`: `MediaStream` \| `null`; `video`: `MediaStream`; \} \| \{ `audio`: `MediaStream`; `video?`: `null`; \} + +Defined in: packages/react-client/dist/hooks/useLivestreamStreamer.d.ts:3 + +## Type declaration + +\{ `audio?`: `MediaStream` \| `null`; `video`: `MediaStream`; \} + +### audio? + +> `optional` **audio**: `MediaStream` \| `null` + +The audio source to publish. e.g. `microphoneStream` from [useMicrophone](../variables/useMicrophone.md) or `stream` from [useScreenShare](../variables/useScreenShare.md) + +### video + +> **video**: `MediaStream` + +The video source to publish. e.g. `cameraStream` from [useCamera](../functions/useCamera.md) or `stream` from [useScreenShare](../variables/useScreenShare.md) + +\{ `audio`: `MediaStream`; `video?`: `null`; \} + +### audio + +> **audio**: `MediaStream` + +### video? + +> `optional` **video**: `null` diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/Track.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/Track.md new file mode 100644 index 00000000..c57eb801 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/Track.md @@ -0,0 +1,53 @@ +# Type Alias: Track + +> **Track** = `object` + +Defined in: packages/react-client/dist/types/public.d.ts:13 + +## Properties + +### encoding + +> **encoding**: [`Variant`](../enumerations/Variant.md) \| `null` + +Defined in: packages/react-client/dist/types/public.d.ts:15 + +*** + +### metadata? + +> `optional` **metadata**: `TrackMetadata` + +Defined in: packages/react-client/dist/types/public.d.ts:17 + +*** + +### simulcastConfig + +> **simulcastConfig**: [`SimulcastConfig`](../interfaces/SimulcastConfig.md) \| `null` + +Defined in: packages/react-client/dist/types/public.d.ts:18 + +*** + +### stream + +> **stream**: `MediaStream` \| `null` + +Defined in: packages/react-client/dist/types/public.d.ts:14 + +*** + +### track + +> **track**: `MediaStreamTrack` \| `null` + +Defined in: packages/react-client/dist/types/public.d.ts:19 + +*** + +### trackId + +> **trackId**: [`TrackId`](TrackId.md) + +Defined in: packages/react-client/dist/types/public.d.ts:16 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/TrackBandwidthLimit.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/TrackBandwidthLimit.md new file mode 100644 index 00000000..bcd31bf7 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/TrackBandwidthLimit.md @@ -0,0 +1,8 @@ +# Type Alias: TrackBandwidthLimit + +> **TrackBandwidthLimit** = `BandwidthLimit` \| [`SimulcastBandwidthLimit`](SimulcastBandwidthLimit.md) + +Defined in: packages/ts-client/dist/index.d.mts:224 + +Type describing bandwidth limitation of a Track, including simulcast and non-simulcast tracks. +A sum type of `BandwidthLimit` and `SimulcastBandwidthLimit` diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/TrackId.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/TrackId.md new file mode 100644 index 00000000..ffa28500 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/TrackId.md @@ -0,0 +1,5 @@ +# Type Alias: TrackId + +> **TrackId** = [`Brand`](Brand.md)\<`string`, `"TrackId"`\> + +Defined in: packages/react-client/dist/types/public.d.ts:11 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/TrackMiddleware.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/TrackMiddleware.md new file mode 100644 index 00000000..7c898c4e --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/TrackMiddleware.md @@ -0,0 +1,5 @@ +# Type Alias: TrackMiddleware + +> **TrackMiddleware** = (`track`) => [`MiddlewareResult`](MiddlewareResult.md) \| `Promise`\<[`MiddlewareResult`](MiddlewareResult.md)\> \| `null` + +Defined in: packages/react-client/dist/types/public.d.ts:25 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/TracksMiddleware.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/TracksMiddleware.md new file mode 100644 index 00000000..14716490 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/TracksMiddleware.md @@ -0,0 +1,16 @@ +# Type Alias: TracksMiddleware() + +> **TracksMiddleware** = (`videoTrack`, `audioTrack`) => [`TracksMiddlewareResult`](TracksMiddlewareResult.md) \| `Promise`\<[`TracksMiddlewareResult`](TracksMiddlewareResult.md)\> + +Defined in: packages/react-client/dist/types/public.d.ts:31 + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `videoTrack` | `MediaStreamTrack` | +| `audioTrack` | `MediaStreamTrack` \| `null` | + +## Returns + +[`TracksMiddlewareResult`](TracksMiddlewareResult.md) \| `Promise`\<[`TracksMiddlewareResult`](TracksMiddlewareResult.md)\> diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/TracksMiddlewareResult.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/TracksMiddlewareResult.md new file mode 100644 index 00000000..b8329571 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/TracksMiddlewareResult.md @@ -0,0 +1,33 @@ +# Type Alias: TracksMiddlewareResult + +> **TracksMiddlewareResult** = `object` + +Defined in: packages/react-client/dist/types/public.d.ts:26 + +## Properties + +### audioTrack + +> **audioTrack**: `MediaStreamTrack` \| `null` + +Defined in: packages/react-client/dist/types/public.d.ts:28 + +*** + +### onClear() + +> **onClear**: () => `void` + +Defined in: packages/react-client/dist/types/public.d.ts:29 + +#### Returns + +`void` + +*** + +### videoTrack + +> **videoTrack**: `MediaStreamTrack` + +Defined in: packages/react-client/dist/types/public.d.ts:27 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/UseInitializeDevicesParams.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/UseInitializeDevicesParams.md new file mode 100644 index 00000000..7243935b --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/UseInitializeDevicesParams.md @@ -0,0 +1,21 @@ +# Type Alias: UseInitializeDevicesParams + +> **UseInitializeDevicesParams** = `object` + +Defined in: packages/react-client/dist/hooks/devices/useInitializeDevices.d.ts:1 + +## Properties + +### enableAudio? + +> `optional` **enableAudio**: `boolean` + +Defined in: packages/react-client/dist/hooks/devices/useInitializeDevices.d.ts:3 + +*** + +### enableVideo? + +> `optional` **enableVideo**: `boolean` + +Defined in: packages/react-client/dist/hooks/devices/useInitializeDevices.d.ts:2 diff --git a/versioned_docs/version-0.25.0/api/mobile/type-aliases/UseSandboxProps.md b/versioned_docs/version-0.25.0/api/mobile/type-aliases/UseSandboxProps.md new file mode 100644 index 00000000..c31a18d1 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/type-aliases/UseSandboxProps.md @@ -0,0 +1,17 @@ +# Type Alias: UseSandboxProps + +> **UseSandboxProps** = `object` + +Defined in: packages/react-client/dist/hooks/useSandbox.d.ts:1 + +## Properties + +### configOverride? + +> `optional` **configOverride**: `object` + +Defined in: packages/react-client/dist/hooks/useSandbox.d.ts:2 + +| Name | Type | +| ------ | ------ | +| `sandboxApiUrl?` | `string` | diff --git a/versioned_docs/version-0.25.0/api/mobile/typedoc-sidebar.cjs b/versioned_docs/version-0.25.0/api/mobile/typedoc-sidebar.cjs new file mode 100644 index 00000000..c12c2896 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/typedoc-sidebar.cjs @@ -0,0 +1,4 @@ +// @ts-check +/** @type {import("@docusaurus/plugin-content-docs").SidebarsConfig} */ +const typedocSidebar = {items:[{type:"category",label:"Connection",items:[{type:"doc",id:"api/mobile/functions/useConnection",label:"useConnection"},{type:"doc",id:"api/mobile/functions/usePeers",label:"usePeers"},{type:"doc",id:"api/mobile/type-aliases/Metadata",label:"Metadata"},{type:"doc",id:"api/mobile/variables/useUpdatePeerMetadata",label:"useUpdatePeerMetadata"},{type:"doc",id:"api/mobile/variables/useVAD",label:"useVAD"}]},{type:"category",label:"Devices",items:[{type:"doc",id:"api/mobile/functions/useCamera",label:"useCamera"},{type:"doc",id:"api/mobile/variables/useInitializeDevices",label:"useInitializeDevices"},{type:"doc",id:"api/mobile/variables/useScreenShare",label:"useScreenShare"}]},{type:"category",label:"Livestream",items:[{type:"doc",id:"api/mobile/interfaces/UseLivestreamStreamerResult",label:"UseLivestreamStreamerResult"},{type:"doc",id:"api/mobile/interfaces/UseLivestreamViewerResult",label:"UseLivestreamViewerResult"},{type:"doc",id:"api/mobile/type-aliases/ConnectStreamerConfig",label:"ConnectStreamerConfig"},{type:"doc",id:"api/mobile/type-aliases/StreamerInputs",label:"StreamerInputs"},{type:"doc",id:"api/mobile/variables/useLivestreamStreamer",label:"useLivestreamStreamer"},{type:"doc",id:"api/mobile/variables/useLivestreamViewer",label:"useLivestreamViewer"}]},{type:"category",label:"Other",items:[{type:"doc",id:"api/mobile/functions/FishjamProvider",label:"FishjamProvider"},{type:"doc",id:"api/mobile/functions/RTCPIPView",label:"RTCPIPView"},{type:"doc",id:"api/mobile/functions/RTCView",label:"RTCView"},{type:"doc",id:"api/mobile/functions/useCustomSource",label:"useCustomSource"},{type:"doc",id:"api/mobile/enumerations/Variant",label:"Variant"},{type:"doc",id:"api/mobile/interfaces/JoinRoomConfig",label:"JoinRoomConfig"},{type:"doc",id:"api/mobile/interfaces/SimulcastConfig",label:"SimulcastConfig"},{type:"doc",id:"api/mobile/type-aliases/AuthErrorReason",label:"AuthErrorReason"},{type:"doc",id:"api/mobile/type-aliases/BandwidthLimits",label:"BandwidthLimits"},{type:"doc",id:"api/mobile/type-aliases/Brand",label:"Brand"},{type:"doc",id:"api/mobile/type-aliases/ConnectViewerConfig",label:"ConnectViewerConfig"},{type:"doc",id:"api/mobile/type-aliases/CustomSource",label:"CustomSource"},{type:"doc",id:"api/mobile/type-aliases/DeviceError",label:"DeviceError"},{type:"doc",id:"api/mobile/type-aliases/DeviceItem",label:"DeviceItem"},{type:"doc",id:"api/mobile/type-aliases/FishjamProviderProps",label:"FishjamProviderProps"},{type:"doc",id:"api/mobile/type-aliases/ForegroundServiceConfig",label:"ForegroundServiceConfig"},{type:"doc",id:"api/mobile/type-aliases/InitializeDevicesResult",label:"InitializeDevicesResult"},{type:"doc",id:"api/mobile/type-aliases/InitializeDevicesSettings",label:"InitializeDevicesSettings"},{type:"doc",id:"api/mobile/type-aliases/InitializeDevicesStatus",label:"InitializeDevicesStatus"},{type:"doc",id:"api/mobile/type-aliases/JoinErrorReason",label:"JoinErrorReason"},{type:"doc",id:"api/mobile/type-aliases/MiddlewareResult",label:"MiddlewareResult"},{type:"doc",id:"api/mobile/type-aliases/PeerId",label:"PeerId"},{type:"doc",id:"api/mobile/type-aliases/PeerStatus",label:"PeerStatus"},{type:"doc",id:"api/mobile/type-aliases/PeerWithTracks",label:"PeerWithTracks"},{type:"doc",id:"api/mobile/type-aliases/PersistLastDeviceHandlers",label:"PersistLastDeviceHandlers"},{type:"doc",id:"api/mobile/type-aliases/ReconnectConfig",label:"ReconnectConfig"},{type:"doc",id:"api/mobile/type-aliases/ReconnectionStatus",label:"ReconnectionStatus"},{type:"doc",id:"api/mobile/type-aliases/RoomType",label:"RoomType"},{type:"doc",id:"api/mobile/type-aliases/RTCPIPViewProps",label:"RTCPIPViewProps"},{type:"doc",id:"api/mobile/type-aliases/RTCVideoViewProps",label:"RTCVideoViewProps"},{type:"doc",id:"api/mobile/type-aliases/SimulcastBandwidthLimit",label:"SimulcastBandwidthLimit"},{type:"doc",id:"api/mobile/type-aliases/SimulcastBandwidthLimits",label:"SimulcastBandwidthLimits"},{type:"doc",id:"api/mobile/type-aliases/StreamConfig",label:"StreamConfig"},{type:"doc",id:"api/mobile/type-aliases/Track",label:"Track"},{type:"doc",id:"api/mobile/type-aliases/TrackBandwidthLimit",label:"TrackBandwidthLimit"},{type:"doc",id:"api/mobile/type-aliases/TrackId",label:"TrackId"},{type:"doc",id:"api/mobile/type-aliases/TrackMiddleware",label:"TrackMiddleware"},{type:"doc",id:"api/mobile/type-aliases/TracksMiddleware",label:"TracksMiddleware"},{type:"doc",id:"api/mobile/type-aliases/TracksMiddlewareResult",label:"TracksMiddlewareResult"},{type:"doc",id:"api/mobile/type-aliases/UseInitializeDevicesParams",label:"UseInitializeDevicesParams"},{type:"doc",id:"api/mobile/type-aliases/UseSandboxProps",label:"UseSandboxProps"},{type:"doc",id:"api/mobile/variables/SimulcastConfig",label:"SimulcastConfig"},{type:"doc",id:"api/mobile/variables/useForegroundService",label:"useForegroundService"},{type:"doc",id:"api/mobile/variables/useMicrophone",label:"useMicrophone"},{type:"doc",id:"api/mobile/variables/useSandbox",label:"useSandbox"}]}]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/versioned_docs/version-0.25.0/api/mobile/variables/SimulcastConfig.md b/versioned_docs/version-0.25.0/api/mobile/variables/SimulcastConfig.md new file mode 100644 index 00000000..04229840 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/variables/SimulcastConfig.md @@ -0,0 +1,5 @@ +# Variable: SimulcastConfig + +> **SimulcastConfig**: `MessageFns`\<[`SimulcastConfig`](../interfaces/SimulcastConfig.md)\> + +Defined in: packages/ts-client/dist/index.d.mts:164 diff --git a/versioned_docs/version-0.25.0/api/mobile/variables/useForegroundService.md b/versioned_docs/version-0.25.0/api/mobile/variables/useForegroundService.md new file mode 100644 index 00000000..1a357726 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/variables/useForegroundService.md @@ -0,0 +1,20 @@ +# Variable: useForegroundService() + +> `const` **useForegroundService**: (`config`) => `void` = `externalUseForegroundService` + +Defined in: [packages/mobile-client/src/useForegroundService.ts:47](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/useForegroundService.ts#L47) + +Hook for managing a foreground service on Android. + +A hook for managing a foreground service on Android. Does nothing on other platforms. +You can use this hook to keep your app running in the background. You're also required to run a foreground service when screen sharing. + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `config` | `ForegroundServiceConfig` | Configuration options for the foreground service. | + +## Returns + +`void` diff --git a/versioned_docs/version-0.25.0/api/mobile/variables/useInitializeDevices.md b/versioned_docs/version-0.25.0/api/mobile/variables/useInitializeDevices.md new file mode 100644 index 00000000..75925b66 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/variables/useInitializeDevices.md @@ -0,0 +1,25 @@ +# Variable: useInitializeDevices() + +> `const` **useInitializeDevices**: () => `object` + +Defined in: packages/react-client/dist/hooks/devices/useInitializeDevices.d.ts:9 + +Hook allows you to initialize access to the devices before joining the room. + +## Returns + +### initializeDevices() + +> **initializeDevices**: (`settings?`) => `Promise`\<[`InitializeDevicesResult`](../type-aliases/InitializeDevicesResult.md)\> + +Initialize access to the devices before joining the room + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `settings?` | [`InitializeDevicesSettings`](../type-aliases/InitializeDevicesSettings.md) | + +#### Returns + +`Promise`\<[`InitializeDevicesResult`](../type-aliases/InitializeDevicesResult.md)\> diff --git a/versioned_docs/version-0.25.0/api/mobile/variables/useLivestreamStreamer.md b/versioned_docs/version-0.25.0/api/mobile/variables/useLivestreamStreamer.md new file mode 100644 index 00000000..3b40632b --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/variables/useLivestreamStreamer.md @@ -0,0 +1,11 @@ +# Variable: useLivestreamStreamer() + +> `const` **useLivestreamStreamer**: () => [`UseLivestreamStreamerResult`](../interfaces/UseLivestreamStreamerResult.md) + +Defined in: packages/react-client/dist/hooks/useLivestreamStreamer.d.ts:39 + +Hook for publishing a livestream, which can be then received with [useLivestreamViewer](useLivestreamViewer.md) + +## Returns + +[`UseLivestreamStreamerResult`](../interfaces/UseLivestreamStreamerResult.md) diff --git a/versioned_docs/version-0.25.0/api/mobile/variables/useLivestreamViewer.md b/versioned_docs/version-0.25.0/api/mobile/variables/useLivestreamViewer.md new file mode 100644 index 00000000..a6aab37b --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/variables/useLivestreamViewer.md @@ -0,0 +1,11 @@ +# Variable: useLivestreamViewer() + +> `const` **useLivestreamViewer**: () => [`UseLivestreamViewerResult`](../interfaces/UseLivestreamViewerResult.md) + +Defined in: packages/react-client/dist/hooks/useLivestreamViewer.d.ts:33 + +Hook for receiving a published livestream. + +## Returns + +[`UseLivestreamViewerResult`](../interfaces/UseLivestreamViewerResult.md) diff --git a/versioned_docs/version-0.25.0/api/mobile/variables/useMicrophone.md b/versioned_docs/version-0.25.0/api/mobile/variables/useMicrophone.md new file mode 100644 index 00000000..4207d59e --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/variables/useMicrophone.md @@ -0,0 +1,9 @@ +# Variable: useMicrophone() + +> `const` **useMicrophone**: () => `Omit`\<`ReturnType`\<*typeof* `useMicrophoneReactClient`\>, `"toggleMicrophoneMute"`\> + +Defined in: [packages/mobile-client/src/index.ts:45](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/mobile-client/src/index.ts#L45) + +## Returns + +`Omit`\<`ReturnType`\<*typeof* `useMicrophoneReactClient`\>, `"toggleMicrophoneMute"`\> diff --git a/versioned_docs/version-0.25.0/api/mobile/variables/useSandbox.md b/versioned_docs/version-0.25.0/api/mobile/variables/useSandbox.md new file mode 100644 index 00000000..db322deb --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/variables/useSandbox.md @@ -0,0 +1,60 @@ +# Variable: useSandbox() + +> `const` **useSandbox**: (`props?`) => `object` + +Defined in: packages/react-client/dist/hooks/useSandbox.d.ts:7 + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `props?` | [`UseSandboxProps`](../type-aliases/UseSandboxProps.md) | + +## Returns + +`object` + +### getSandboxLivestream() + +> **getSandboxLivestream**: (`roomName`, `isPublic?`) => `Promise`\<\{ `room`: \{ `id`: `string`; `name`: `string`; \}; `streamerToken`: `string`; \}\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomName` | `string` | +| `isPublic?` | `boolean` | + +#### Returns + +`Promise`\<\{ `room`: \{ `id`: `string`; `name`: `string`; \}; `streamerToken`: `string`; \}\> + +### getSandboxPeerToken() + +> **getSandboxPeerToken**: (`roomName`, `peerName`, `roomType?`) => `Promise`\<`string`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomName` | `string` | +| `peerName` | `string` | +| `roomType?` | [`RoomType`](../type-aliases/RoomType.md) | + +#### Returns + +`Promise`\<`string`\> + +### getSandboxViewerToken() + +> **getSandboxViewerToken**: (`roomName`) => `Promise`\<`string`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomName` | `string` | + +#### Returns + +`Promise`\<`string`\> diff --git a/versioned_docs/version-0.25.0/api/mobile/variables/useScreenShare.md b/versioned_docs/version-0.25.0/api/mobile/variables/useScreenShare.md new file mode 100644 index 00000000..0b746606 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/variables/useScreenShare.md @@ -0,0 +1,81 @@ +# Variable: useScreenShare() + +> `const` **useScreenShare**: () => `object` + +Defined in: packages/react-client/dist/hooks/useScreenShare.d.ts:6 + +Hook to enable screen sharing within a room and manage the existing stream. + +## Returns + +### audioTrack + +> **audioTrack**: `MediaStreamTrack` \| `null` + +The separate audio MediaStreamTrack. + +### currentTracksMiddleware + +> **currentTracksMiddleware**: [`TracksMiddleware`](../type-aliases/TracksMiddleware.md) \| `null` + +The middleware currently assigned to process the tracks. +A screenshare may include both audio and video tracks, and this middleware is capable of processing +each track type. + +### setTracksMiddleware() + +> **setTracksMiddleware**: (`middleware`) => `Promise`\<`void`\> + +Sets the middleware responsible for processing the tracks. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `middleware` | [`TracksMiddleware`](../type-aliases/TracksMiddleware.md) \| `null` | The middleware to set, which can be a TracksMiddleware instance or null to remove the middleware. | + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves once the middleware is successfully set. + +### startStreaming() + +> **startStreaming**: (`props?`) => `Promise`\<`void`\> + +Invokes the screen sharing prompt in the user's browser and starts streaming upon approval. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `props?` | \{ `audioConstraints?`: `boolean` \| `MediaTrackConstraints`; `videoConstraints?`: `boolean` \| `MediaTrackConstraints`; \} | +| `props.audioConstraints?` | `boolean` \| `MediaTrackConstraints` | +| `props.videoConstraints?` | `boolean` \| `MediaTrackConstraints` | + +#### Returns + +`Promise`\<`void`\> + +### stopStreaming() + +> **stopStreaming**: () => `Promise`\<`void`\> + +Stops the stream and cancels browser screen sharing. + +#### Returns + +`Promise`\<`void`\> + +### stream + +> **stream**: `MediaStream` \| `null` + +The MediaStream object containing both tracks. + +### videoTrack + +> **videoTrack**: `MediaStreamTrack` \| `null` + +The separate video MediaStreamTrack. diff --git a/versioned_docs/version-0.25.0/api/mobile/variables/useUpdatePeerMetadata.md b/versioned_docs/version-0.25.0/api/mobile/variables/useUpdatePeerMetadata.md new file mode 100644 index 00000000..16732fb2 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/variables/useUpdatePeerMetadata.md @@ -0,0 +1,31 @@ +# Variable: useUpdatePeerMetadata() + +> `const` **useUpdatePeerMetadata**: \<`PeerMetadata`\>() => `object` + +Defined in: packages/react-client/dist/hooks/useUpdatePeerMetadata.d.ts:8 + +Hook provides a method to update the metadata of the local peer. + +## Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `PeerMetadata` *extends* `GenericMetadata` | `GenericMetadata` | + +## Returns + +### updatePeerMetadata() + +> **updatePeerMetadata**: (`peerMetadata`) => `void` + +Updates metadata visible to other peers + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `peerMetadata` | `PeerMetadata` | + +#### Returns + +`void` diff --git a/versioned_docs/version-0.25.0/api/mobile/variables/useVAD.md b/versioned_docs/version-0.25.0/api/mobile/variables/useVAD.md new file mode 100644 index 00000000..53793985 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/mobile/variables/useVAD.md @@ -0,0 +1,20 @@ +# Variable: useVAD() + +> `const` **useVAD**: (`options`) => `Record`\<[`PeerId`](../type-aliases/PeerId.md), `boolean`\> + +Defined in: packages/react-client/dist/hooks/useVAD.d.ts:21 + +Voice activity detection. Use this hook to check if voice is detected in audio track for given peer(s). + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `options` | \{ `peerIds`: `ReadonlyArray`\<[`PeerId`](../type-aliases/PeerId.md)\>; \} | Options object containing `peerIds` - a list of ids of peers to subscribe to for voice activity detection notifications. Example usage: `import { useVAD, type PeerId } from "@fishjam-cloud/react-client"; function WhoIsTalkingComponent({ peerIds }: { peerIds: PeerId[] }) { const peersInfo = useVAD({peerIds}); const activePeers = (Object.keys(peersInfo) as PeerId[]).filter((peerId) => peersInfo[peerId]); return "Now talking: " + activePeers.join(", "); }` | +| `options.peerIds` | `ReadonlyArray`\<[`PeerId`](../type-aliases/PeerId.md)\> | - | + +## Returns + +`Record`\<[`PeerId`](../type-aliases/PeerId.md), `boolean`\> + +Each key is a peerId and the boolean value indicates if voice activity is currently detected for that peer. diff --git a/versioned_docs/version-0.25.0/api/reference.md b/versioned_docs/version-0.25.0/api/reference.md new file mode 100644 index 00000000..4d4a4810 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/reference.md @@ -0,0 +1,50 @@ +--- +type: reference +--- + +# Reference + +Describes APIs for direct interaction with Fishjam. + +Fishjam publishes documentation for the Sandbox API and Fishjam Server APIs. + +## Sandbox API + +[Sandbox API OpenAPI](https://github.com/fishjam-cloud/documentation/tree/main/static/api/room-manager-openapi.yaml) + +See also: [What is the Sandbox API?](../explanation/sandbox-api-concept) + +## Server + +Fishjam Server provides a REST API for managing rooms and peers, and +[Protobufs](https://protobuf.dev) for +receiving structured live updates from the server. +The notifications can be configured using Webhook or Websocket. + +### REST API + +[Server OpenAPI](https://github.com/fishjam-cloud/documentation/tree/main/static/api/fishjam-server-openapi.yaml) + +### Protobufs + +- [Server Notification Protobufs](https://github.com/fishjam-cloud/documentation/tree/main/static/api/protobuf/server_notifications.proto) +- [Agent Message Protobufs](https://github.com/fishjam-cloud/documentation/tree/main/static/api/protobuf/agent_notifications.proto) + +#### Webhook + +When using webhooks for receiving notifications, the `webhookUrl` must be passed +in the `RoomConfig` options when creating a room. + +The HTTP POST to the `webhookUrl` uses "application/x-protobuf" content type. +The body is binary data, that represents encoded `ServerMessage`. + +For more information see also [server setup documentation](../how-to/backend/server-setup#webhooks) + +#### Websocket + +After opening the Websocket connection to +`https://fishjam.io/api/v1/connect/{fishjamId}/socket/server/websocket`, +the first message that must be sent is an `AuthRequest`, +with a valid Management Token. + +Next, you can should subscribe to notifications by sending `SubscribeRequest` event with `SERVER_NOTIFICATION` event type. diff --git a/versioned_docs/version-0.25.0/api/server/classes/BadRequestException.md b/versioned_docs/version-0.25.0/api/server/classes/BadRequestException.md new file mode 100644 index 00000000..24c9190c --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/BadRequestException.md @@ -0,0 +1,65 @@ +# Class: BadRequestException + +Defined in: [js-server-sdk/src/exceptions/index.ts:21](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L21) + +## Extends + +- [`FishjamBaseException`](FishjamBaseException.md) + +## Constructors + +### Constructor + +> **new BadRequestException**(`error`): `BadRequestException` + +Defined in: [js-server-sdk/src/exceptions/index.ts:13](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `error` | `AxiosError`\<`Record`\<`string`, `string`\>\> | + +#### Returns + +`BadRequestException` + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`constructor`](FishjamBaseException.md#constructor) + +## Properties + +### axiosCode? + +> `optional` **axiosCode**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:11](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L11) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`axiosCode`](FishjamBaseException.md#axioscode) + +*** + +### details? + +> `optional` **details**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:12](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L12) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`details`](FishjamBaseException.md#details) + +*** + +### statusCode + +> **statusCode**: `number` + +Defined in: [js-server-sdk/src/exceptions/index.ts:10](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L10) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`statusCode`](FishjamBaseException.md#statuscode) diff --git a/versioned_docs/version-0.25.0/api/server/classes/FishjamAgent.md b/versioned_docs/version-0.25.0/api/server/classes/FishjamAgent.md new file mode 100644 index 00000000..db6b8967 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/FishjamAgent.md @@ -0,0 +1,146 @@ +# Class: FishjamAgent + +Defined in: [js-server-sdk/src/agent.ts:42](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L42) + +## Extends + +- `TypedEventEmitter`\<[`AgentEvents`](../type-aliases/AgentEvents.md), `this`\> + +## Constructors + +### Constructor + +> **new FishjamAgent**(`config`, `agentToken`, `callbacks?`): `FishjamAgent` + +Defined in: [js-server-sdk/src/agent.ts:48](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L48) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`FishjamConfig`](../type-aliases/FishjamConfig.md) | +| `agentToken` | `string` | +| `callbacks?` | [`AgentCallbacks`](../type-aliases/AgentCallbacks.md) | + +#### Returns + +`FishjamAgent` + +#### Overrides + +`(EventEmitter as new () => TypedEmitter).constructor` + +## Methods + +### awaitConnected() + +> **awaitConnected**(): `Promise`\<`void`\> + +Defined in: [js-server-sdk/src/agent.ts:72](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L72) + +Await Agent connection to Fishjam. + +#### Returns + +`Promise`\<`void`\> + +*** + +### createTrack() + +> **createTrack**(`codecParameters`, `metadata`): [`AgentTrack`](../type-aliases/AgentTrack.md) + +Defined in: [js-server-sdk/src/agent.ts:80](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L80) + +Creates an outgoing audio track for the agent + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `codecParameters` | [`AudioCodecParameters`](../type-aliases/AudioCodecParameters.md) | +| `metadata` | `object` | + +#### Returns + +[`AgentTrack`](../type-aliases/AgentTrack.md) + +a new audio track + +*** + +### deleteTrack() + +> **deleteTrack**(`trackId`): `void` + +Defined in: [js-server-sdk/src/agent.ts:112](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L112) + +Deletes an outgoing audio track for the agent + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `trackId` | [`TrackId`](../type-aliases/TrackId.md) | + +#### Returns + +`void` + +*** + +### disconnect() + +> **disconnect**(): `void` + +Defined in: [js-server-sdk/src/agent.ts:127](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L127) + +#### Returns + +`void` + +*** + +### interruptTrack() + +> **interruptTrack**(`trackId`): `void` + +Defined in: [js-server-sdk/src/agent.ts:103](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L103) + +Interrupt track identified by `trackId`. + +Any audio that has been sent by the agent, but not played +by Fishjam will be cleared and be prevented from playing. + +Audio sent after the interrupt will be played normally. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `trackId` | [`TrackId`](../type-aliases/TrackId.md) | + +#### Returns + +`void` + +*** + +### sendData() + +> **sendData**(`trackId`, `data`): `void` + +Defined in: [js-server-sdk/src/agent.ts:121](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L121) + +Send audio data for the given track + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `trackId` | [`TrackId`](../type-aliases/TrackId.md) | +| `data` | `Uint8Array` | + +#### Returns + +`void` diff --git a/versioned_docs/version-0.25.0/api/server/classes/FishjamBaseException.md b/versioned_docs/version-0.25.0/api/server/classes/FishjamBaseException.md new file mode 100644 index 00000000..db9e6d21 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/FishjamBaseException.md @@ -0,0 +1,64 @@ +# Class: FishjamBaseException + +Defined in: [js-server-sdk/src/exceptions/index.ts:9](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L9) + +## Extends + +- `Error` + +## Extended by + +- [`BadRequestException`](BadRequestException.md) +- [`UnauthorizedException`](UnauthorizedException.md) +- [`ForbiddenException`](ForbiddenException.md) +- [`RoomNotFoundException`](RoomNotFoundException.md) +- [`FishjamNotFoundException`](FishjamNotFoundException.md) +- [`PeerNotFoundException`](PeerNotFoundException.md) +- [`ServiceUnavailableException`](ServiceUnavailableException.md) +- [`UnknownException`](UnknownException.md) + +## Constructors + +### Constructor + +> **new FishjamBaseException**(`error`): `FishjamBaseException` + +Defined in: [js-server-sdk/src/exceptions/index.ts:13](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `error` | `AxiosError`\<`Record`\<`string`, `string`\>\> | + +#### Returns + +`FishjamBaseException` + +#### Overrides + +`Error.constructor` + +## Properties + +### axiosCode? + +> `optional` **axiosCode**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:11](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L11) + +*** + +### details? + +> `optional` **details**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:12](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L12) + +*** + +### statusCode + +> **statusCode**: `number` + +Defined in: [js-server-sdk/src/exceptions/index.ts:10](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L10) diff --git a/versioned_docs/version-0.25.0/api/server/classes/FishjamClient.md b/versioned_docs/version-0.25.0/api/server/classes/FishjamClient.md new file mode 100644 index 00000000..965ea084 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/FishjamClient.md @@ -0,0 +1,286 @@ +# Class: FishjamClient + +Defined in: [js-server-sdk/src/client.ts:21](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L21) + +Client class that allows to manage Rooms and Peers for a Fishjam App. +It requires the Fishjam ID and management token that can be retrieved from the Fishjam Dashboard. + +## Constructors + +### Constructor + +> **new FishjamClient**(`config`): `FishjamClient` + +Defined in: [js-server-sdk/src/client.ts:39](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L39) + +Create new instance of Fishjam Client. + +Example usage: +``` +const fishjamClient = new FishjamClient({ + fishjamId: fastify.config.FISHJAM_ID, + managementToken: fastify.config.FISHJAM_MANAGEMENT_TOKEN, +}); +``` + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`FishjamConfig`](../type-aliases/FishjamConfig.md) | + +#### Returns + +`FishjamClient` + +## Methods + +### createAgent() + +> **createAgent**(`roomId`, `options`, `callbacks?`): `Promise`\<\{ `agent`: [`FishjamAgent`](FishjamAgent.md); `peer`: [`Peer`](../type-aliases/Peer.md); \}\> + +Defined in: [js-server-sdk/src/client.ts:142](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L142) + +Create a new agent assigned to a room. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomId` | [`RoomId`](../type-aliases/RoomId.md) | +| `options` | [`PeerOptionsAgent`](../interfaces/PeerOptionsAgent.md) | +| `callbacks?` | [`AgentCallbacks`](../type-aliases/AgentCallbacks.md) | + +#### Returns + +`Promise`\<\{ `agent`: [`FishjamAgent`](FishjamAgent.md); `peer`: [`Peer`](../type-aliases/Peer.md); \}\> + +*** + +### createLivestreamStreamerToken() + +> **createLivestreamStreamerToken**(`roomId`): `Promise`\<[`StreamerToken`](../interfaces/StreamerToken.md)\> + +Defined in: [js-server-sdk/src/client.ts:243](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L243) + +Creates a livestream streamer token for the given room. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomId` | [`RoomId`](../type-aliases/RoomId.md) | + +#### Returns + +`Promise`\<[`StreamerToken`](../interfaces/StreamerToken.md)\> + +a livestream streamer token + +*** + +### createLivestreamViewerToken() + +> **createLivestreamViewerToken**(`roomId`): `Promise`\<[`ViewerToken`](../interfaces/ViewerToken.md)\> + +Defined in: [js-server-sdk/src/client.ts:230](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L230) + +Creates a livestream viewer token for the given room. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomId` | [`RoomId`](../type-aliases/RoomId.md) | + +#### Returns + +`Promise`\<[`ViewerToken`](../interfaces/ViewerToken.md)\> + +a livestream viewer token + +*** + +### createPeer() + +> **createPeer**(`roomId`, `options`): `Promise`\<\{ `peer`: [`Peer`](../type-aliases/Peer.md); `peerToken`: `string`; \}\> + +Defined in: [js-server-sdk/src/client.ts:122](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L122) + +Create a new peer assigned to a room. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomId` | [`RoomId`](../type-aliases/RoomId.md) | +| `options` | [`PeerOptionsWebRTC`](../interfaces/PeerOptionsWebRTC.md) | + +#### Returns + +`Promise`\<\{ `peer`: [`Peer`](../type-aliases/Peer.md); `peerToken`: `string`; \}\> + +*** + +### createRoom() + +> **createRoom**(`config`): `Promise`\<[`Room`](../type-aliases/Room.md)\> + +Defined in: [js-server-sdk/src/client.ts:80](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L80) + +Create a new room. All peers connected to the same room will be able to send/receive streams to each other. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`RoomConfig`](../interfaces/RoomConfig.md) | + +#### Returns + +`Promise`\<[`Room`](../type-aliases/Room.md)\> + +*** + +### deletePeer() + +> **deletePeer**(`roomId`, `peerId`): `Promise`\<`void`\> + +Defined in: [js-server-sdk/src/client.ts:180](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L180) + +Delete a peer - this will also disconnect the peer from the room. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomId` | [`RoomId`](../type-aliases/RoomId.md) | +| `peerId` | [`PeerId`](../type-aliases/PeerId.md) | + +#### Returns + +`Promise`\<`void`\> + +*** + +### deleteRoom() + +> **deleteRoom**(`roomId`): `Promise`\<`void`\> + +Defined in: [js-server-sdk/src/client.ts:99](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L99) + +Delete an existing room. All peers connected to this room will be disconnected and removed. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomId` | [`RoomId`](../type-aliases/RoomId.md) | + +#### Returns + +`Promise`\<`void`\> + +*** + +### getAllRooms() + +> **getAllRooms**(): `Promise`\<[`Room`](../type-aliases/Room.md)[]\> + +Defined in: [js-server-sdk/src/client.ts:110](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L110) + +Get a list of all existing rooms. + +#### Returns + +`Promise`\<[`Room`](../type-aliases/Room.md)[]\> + +*** + +### getRoom() + +> **getRoom**(`roomId`): `Promise`\<[`Room`](../type-aliases/Room.md)\> + +Defined in: [js-server-sdk/src/client.ts:168](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L168) + +Get details about a given room. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomId` | [`RoomId`](../type-aliases/RoomId.md) | + +#### Returns + +`Promise`\<[`Room`](../type-aliases/Room.md)\> + +*** + +### refreshPeerToken() + +> **refreshPeerToken**(`roomId`, `peerId`): `Promise`\<`string`\> + +Defined in: [js-server-sdk/src/client.ts:217](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L217) + +Refresh the peer token for an already existing peer. +If an already created peer has not been connected to the room for more than 24 hours, the token will become invalid. This method can be used to generate a new peer token for the existing peer. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomId` | [`RoomId`](../type-aliases/RoomId.md) | +| `peerId` | [`PeerId`](../type-aliases/PeerId.md) | + +#### Returns + +`Promise`\<`string`\> + +refreshed peer token + +*** + +### subscribePeer() + +> **subscribePeer**(`roomId`, `subscriberPeerId`, `publisherPeerId`): `Promise`\<`void`\> + +Defined in: [js-server-sdk/src/client.ts:192](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L192) + +Subscribe a peer to another peer - this will make all tracks from the publisher available to the subscriber. +Using this function only makes sense if subscribeMode is set to manual + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomId` | [`RoomId`](../type-aliases/RoomId.md) | +| `subscriberPeerId` | [`PeerId`](../type-aliases/PeerId.md) | +| `publisherPeerId` | [`PeerId`](../type-aliases/PeerId.md) | + +#### Returns + +`Promise`\<`void`\> + +*** + +### subscribeTracks() + +> **subscribeTracks**(`roomId`, `subscriberPeerId`, `tracks`): `Promise`\<`void`\> + +Defined in: [js-server-sdk/src/client.ts:204](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/client.ts#L204) + +Subscribe a peer to specific tracks from another peer - this will make only the specified tracks from the publisher available to the subscriber. +Using this function only makes sense if subscribeMode is set to manual + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomId` | [`RoomId`](../type-aliases/RoomId.md) | +| `subscriberPeerId` | [`PeerId`](../type-aliases/PeerId.md) | +| `tracks` | [`TrackId`](../type-aliases/TrackId.md)[] | + +#### Returns + +`Promise`\<`void`\> diff --git a/versioned_docs/version-0.25.0/api/server/classes/FishjamNotFoundException.md b/versioned_docs/version-0.25.0/api/server/classes/FishjamNotFoundException.md new file mode 100644 index 00000000..db63a443 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/FishjamNotFoundException.md @@ -0,0 +1,65 @@ +# Class: FishjamNotFoundException + +Defined in: [js-server-sdk/src/exceptions/index.ts:29](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L29) + +## Extends + +- [`FishjamBaseException`](FishjamBaseException.md) + +## Constructors + +### Constructor + +> **new FishjamNotFoundException**(`error`): `FishjamNotFoundException` + +Defined in: [js-server-sdk/src/exceptions/index.ts:13](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `error` | `AxiosError`\<`Record`\<`string`, `string`\>\> | + +#### Returns + +`FishjamNotFoundException` + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`constructor`](FishjamBaseException.md#constructor) + +## Properties + +### axiosCode? + +> `optional` **axiosCode**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:11](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L11) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`axiosCode`](FishjamBaseException.md#axioscode) + +*** + +### details? + +> `optional` **details**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:12](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L12) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`details`](FishjamBaseException.md#details) + +*** + +### statusCode + +> **statusCode**: `number` + +Defined in: [js-server-sdk/src/exceptions/index.ts:10](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L10) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`statusCode`](FishjamBaseException.md#statuscode) diff --git a/versioned_docs/version-0.25.0/api/server/classes/FishjamWSNotifier.md b/versioned_docs/version-0.25.0/api/server/classes/FishjamWSNotifier.md new file mode 100644 index 00000000..d5b908dd --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/FishjamWSNotifier.md @@ -0,0 +1,33 @@ +# Class: FishjamWSNotifier + +Defined in: [js-server-sdk/src/ws\_notifier.ts:76](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L76) + +Notifier object that can be used to get notified about various events related to the Fishjam App. + +## Extends + +- `TypedEventEmitter`\<[`NotificationEvents`](../type-aliases/NotificationEvents.md), `this`\> + +## Constructors + +### Constructor + +> **new FishjamWSNotifier**(`config`, `onError`, `onClose`): `FishjamWSNotifier` + +Defined in: [js-server-sdk/src/ws\_notifier.ts:79](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L79) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`FishjamConfig`](../type-aliases/FishjamConfig.md) | +| `onError` | [`ErrorEventHandler`](../type-aliases/ErrorEventHandler.md) | +| `onClose` | [`CloseEventHandler`](../type-aliases/CloseEventHandler.md) | + +#### Returns + +`FishjamWSNotifier` + +#### Overrides + +`(EventEmitter as new () => TypedEmitter).constructor` diff --git a/versioned_docs/version-0.25.0/api/server/classes/ForbiddenException.md b/versioned_docs/version-0.25.0/api/server/classes/ForbiddenException.md new file mode 100644 index 00000000..946746b2 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/ForbiddenException.md @@ -0,0 +1,65 @@ +# Class: ForbiddenException + +Defined in: [js-server-sdk/src/exceptions/index.ts:25](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L25) + +## Extends + +- [`FishjamBaseException`](FishjamBaseException.md) + +## Constructors + +### Constructor + +> **new ForbiddenException**(`error`): `ForbiddenException` + +Defined in: [js-server-sdk/src/exceptions/index.ts:13](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `error` | `AxiosError`\<`Record`\<`string`, `string`\>\> | + +#### Returns + +`ForbiddenException` + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`constructor`](FishjamBaseException.md#constructor) + +## Properties + +### axiosCode? + +> `optional` **axiosCode**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:11](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L11) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`axiosCode`](FishjamBaseException.md#axioscode) + +*** + +### details? + +> `optional` **details**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:12](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L12) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`details`](FishjamBaseException.md#details) + +*** + +### statusCode + +> **statusCode**: `number` + +Defined in: [js-server-sdk/src/exceptions/index.ts:10](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L10) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`statusCode`](FishjamBaseException.md#statuscode) diff --git a/versioned_docs/version-0.25.0/api/server/classes/MissingFishjamIdException.md b/versioned_docs/version-0.25.0/api/server/classes/MissingFishjamIdException.md new file mode 100644 index 00000000..7c6299cc --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/MissingFishjamIdException.md @@ -0,0 +1,23 @@ +# Class: MissingFishjamIdException + +Defined in: [js-server-sdk/src/exceptions/index.ts:3](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L3) + +## Extends + +- `Error` + +## Constructors + +### Constructor + +> **new MissingFishjamIdException**(): `MissingFishjamIdException` + +Defined in: [js-server-sdk/src/exceptions/index.ts:4](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L4) + +#### Returns + +`MissingFishjamIdException` + +#### Overrides + +`Error.constructor` diff --git a/versioned_docs/version-0.25.0/api/server/classes/PeerNotFoundException.md b/versioned_docs/version-0.25.0/api/server/classes/PeerNotFoundException.md new file mode 100644 index 00000000..fabcc898 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/PeerNotFoundException.md @@ -0,0 +1,65 @@ +# Class: PeerNotFoundException + +Defined in: [js-server-sdk/src/exceptions/index.ts:31](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L31) + +## Extends + +- [`FishjamBaseException`](FishjamBaseException.md) + +## Constructors + +### Constructor + +> **new PeerNotFoundException**(`error`): `PeerNotFoundException` + +Defined in: [js-server-sdk/src/exceptions/index.ts:13](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `error` | `AxiosError`\<`Record`\<`string`, `string`\>\> | + +#### Returns + +`PeerNotFoundException` + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`constructor`](FishjamBaseException.md#constructor) + +## Properties + +### axiosCode? + +> `optional` **axiosCode**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:11](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L11) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`axiosCode`](FishjamBaseException.md#axioscode) + +*** + +### details? + +> `optional` **details**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:12](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L12) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`details`](FishjamBaseException.md#details) + +*** + +### statusCode + +> **statusCode**: `number` + +Defined in: [js-server-sdk/src/exceptions/index.ts:10](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L10) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`statusCode`](FishjamBaseException.md#statuscode) diff --git a/versioned_docs/version-0.25.0/api/server/classes/RoomNotFoundException.md b/versioned_docs/version-0.25.0/api/server/classes/RoomNotFoundException.md new file mode 100644 index 00000000..905e554e --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/RoomNotFoundException.md @@ -0,0 +1,65 @@ +# Class: RoomNotFoundException + +Defined in: [js-server-sdk/src/exceptions/index.ts:27](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L27) + +## Extends + +- [`FishjamBaseException`](FishjamBaseException.md) + +## Constructors + +### Constructor + +> **new RoomNotFoundException**(`error`): `RoomNotFoundException` + +Defined in: [js-server-sdk/src/exceptions/index.ts:13](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `error` | `AxiosError`\<`Record`\<`string`, `string`\>\> | + +#### Returns + +`RoomNotFoundException` + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`constructor`](FishjamBaseException.md#constructor) + +## Properties + +### axiosCode? + +> `optional` **axiosCode**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:11](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L11) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`axiosCode`](FishjamBaseException.md#axioscode) + +*** + +### details? + +> `optional` **details**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:12](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L12) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`details`](FishjamBaseException.md#details) + +*** + +### statusCode + +> **statusCode**: `number` + +Defined in: [js-server-sdk/src/exceptions/index.ts:10](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L10) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`statusCode`](FishjamBaseException.md#statuscode) diff --git a/versioned_docs/version-0.25.0/api/server/classes/ServiceUnavailableException.md b/versioned_docs/version-0.25.0/api/server/classes/ServiceUnavailableException.md new file mode 100644 index 00000000..f039b3ca --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/ServiceUnavailableException.md @@ -0,0 +1,65 @@ +# Class: ServiceUnavailableException + +Defined in: [js-server-sdk/src/exceptions/index.ts:33](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L33) + +## Extends + +- [`FishjamBaseException`](FishjamBaseException.md) + +## Constructors + +### Constructor + +> **new ServiceUnavailableException**(`error`): `ServiceUnavailableException` + +Defined in: [js-server-sdk/src/exceptions/index.ts:13](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `error` | `AxiosError`\<`Record`\<`string`, `string`\>\> | + +#### Returns + +`ServiceUnavailableException` + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`constructor`](FishjamBaseException.md#constructor) + +## Properties + +### axiosCode? + +> `optional` **axiosCode**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:11](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L11) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`axiosCode`](FishjamBaseException.md#axioscode) + +*** + +### details? + +> `optional` **details**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:12](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L12) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`details`](FishjamBaseException.md#details) + +*** + +### statusCode + +> **statusCode**: `number` + +Defined in: [js-server-sdk/src/exceptions/index.ts:10](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L10) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`statusCode`](FishjamBaseException.md#statuscode) diff --git a/versioned_docs/version-0.25.0/api/server/classes/UnauthorizedException.md b/versioned_docs/version-0.25.0/api/server/classes/UnauthorizedException.md new file mode 100644 index 00000000..f29c2408 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/UnauthorizedException.md @@ -0,0 +1,65 @@ +# Class: UnauthorizedException + +Defined in: [js-server-sdk/src/exceptions/index.ts:23](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L23) + +## Extends + +- [`FishjamBaseException`](FishjamBaseException.md) + +## Constructors + +### Constructor + +> **new UnauthorizedException**(`error`): `UnauthorizedException` + +Defined in: [js-server-sdk/src/exceptions/index.ts:13](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `error` | `AxiosError`\<`Record`\<`string`, `string`\>\> | + +#### Returns + +`UnauthorizedException` + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`constructor`](FishjamBaseException.md#constructor) + +## Properties + +### axiosCode? + +> `optional` **axiosCode**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:11](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L11) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`axiosCode`](FishjamBaseException.md#axioscode) + +*** + +### details? + +> `optional` **details**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:12](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L12) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`details`](FishjamBaseException.md#details) + +*** + +### statusCode + +> **statusCode**: `number` + +Defined in: [js-server-sdk/src/exceptions/index.ts:10](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L10) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`statusCode`](FishjamBaseException.md#statuscode) diff --git a/versioned_docs/version-0.25.0/api/server/classes/UnknownException.md b/versioned_docs/version-0.25.0/api/server/classes/UnknownException.md new file mode 100644 index 00000000..c5fad506 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/classes/UnknownException.md @@ -0,0 +1,65 @@ +# Class: UnknownException + +Defined in: [js-server-sdk/src/exceptions/index.ts:35](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L35) + +## Extends + +- [`FishjamBaseException`](FishjamBaseException.md) + +## Constructors + +### Constructor + +> **new UnknownException**(`error`): `UnknownException` + +Defined in: [js-server-sdk/src/exceptions/index.ts:13](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `error` | `AxiosError`\<`Record`\<`string`, `string`\>\> | + +#### Returns + +`UnknownException` + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`constructor`](FishjamBaseException.md#constructor) + +## Properties + +### axiosCode? + +> `optional` **axiosCode**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:11](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L11) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`axiosCode`](FishjamBaseException.md#axioscode) + +*** + +### details? + +> `optional` **details**: `string` + +Defined in: [js-server-sdk/src/exceptions/index.ts:12](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L12) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`details`](FishjamBaseException.md#details) + +*** + +### statusCode + +> **statusCode**: `number` + +Defined in: [js-server-sdk/src/exceptions/index.ts:10](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/exceptions/index.ts#L10) + +#### Inherited from + +[`FishjamBaseException`](FishjamBaseException.md).[`statusCode`](FishjamBaseException.md#statuscode) diff --git a/versioned_docs/version-0.25.0/api/server/enumerations/PeerStatus.md b/versioned_docs/version-0.25.0/api/server/enumerations/PeerStatus.md new file mode 100644 index 00000000..ab87ec29 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/enumerations/PeerStatus.md @@ -0,0 +1,23 @@ +# Enumeration: PeerStatus + +Defined in: fishjam-openapi/dist/index.d.ts:363 + +Informs about the peer status + +## Export + +## Enumeration Members + +### Connected + +> **Connected**: `"connected"` + +Defined in: fishjam-openapi/dist/index.d.ts:364 + +*** + +### Disconnected + +> **Disconnected**: `"disconnected"` + +Defined in: fishjam-openapi/dist/index.d.ts:365 diff --git a/versioned_docs/version-0.25.0/api/server/enumerations/RoomType.md b/versioned_docs/version-0.25.0/api/server/enumerations/RoomType.md new file mode 100644 index 00000000..669997bf --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/enumerations/RoomType.md @@ -0,0 +1,55 @@ +# Enumeration: RoomType + +Defined in: fishjam-openapi/dist/index.d.ts:490 + +The use-case of the room. If not provided, this defaults to conference. + +## Export + +## Enumeration Members + +### AudioOnly + +> **AudioOnly**: `"audio_only"` + +Defined in: fishjam-openapi/dist/index.d.ts:492 + +*** + +### AudioOnlyLivestream + +> **AudioOnlyLivestream**: `"audio_only_livestream"` + +Defined in: fishjam-openapi/dist/index.d.ts:496 + +*** + +### Broadcaster + +> **Broadcaster**: `"broadcaster"` + +Defined in: fishjam-openapi/dist/index.d.ts:493 + +*** + +### Conference + +> **Conference**: `"conference"` + +Defined in: fishjam-openapi/dist/index.d.ts:495 + +*** + +### FullFeature + +> **FullFeature**: `"full_feature"` + +Defined in: fishjam-openapi/dist/index.d.ts:491 + +*** + +### Livestream + +> **Livestream**: `"livestream"` + +Defined in: fishjam-openapi/dist/index.d.ts:494 diff --git a/versioned_docs/version-0.25.0/api/server/enumerations/VideoCodec.md b/versioned_docs/version-0.25.0/api/server/enumerations/VideoCodec.md new file mode 100644 index 00000000..f5cee5bb --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/enumerations/VideoCodec.md @@ -0,0 +1,23 @@ +# Enumeration: VideoCodec + +Defined in: fishjam-openapi/dist/index.d.ts:712 + +Enforces video codec for each peer in the room + +## Export + +## Enumeration Members + +### H264 + +> **H264**: `"h264"` + +Defined in: fishjam-openapi/dist/index.d.ts:713 + +*** + +### Vp8 + +> **Vp8**: `"vp8"` + +Defined in: fishjam-openapi/dist/index.d.ts:714 diff --git a/versioned_docs/version-0.25.0/api/server/index.md b/versioned_docs/version-0.25.0/api/server/index.md new file mode 100644 index 00000000..ee74d762 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/index.md @@ -0,0 +1,66 @@ +# @fishjam-cloud/js-server-sdk + +## Client + +- [FishjamClient](classes/FishjamClient.md) +- [FishjamWSNotifier](classes/FishjamWSNotifier.md) + +## Other + +- [PeerStatus](enumerations/PeerStatus.md) +- [RoomType](enumerations/RoomType.md) +- [VideoCodec](enumerations/VideoCodec.md) +- [BadRequestException](classes/BadRequestException.md) +- [FishjamAgent](classes/FishjamAgent.md) +- [FishjamBaseException](classes/FishjamBaseException.md) +- [FishjamNotFoundException](classes/FishjamNotFoundException.md) +- [ForbiddenException](classes/ForbiddenException.md) +- [MissingFishjamIdException](classes/MissingFishjamIdException.md) +- [PeerNotFoundException](classes/PeerNotFoundException.md) +- [RoomNotFoundException](classes/RoomNotFoundException.md) +- [ServiceUnavailableException](classes/ServiceUnavailableException.md) +- [UnauthorizedException](classes/UnauthorizedException.md) +- [UnknownException](classes/UnknownException.md) +- [PeerOptionsAgent](interfaces/PeerOptionsAgent.md) +- [PeerOptionsWebRTC](interfaces/PeerOptionsWebRTC.md) +- [RoomConfig](interfaces/RoomConfig.md) +- [ServerMessage](interfaces/ServerMessage.md) +- [StreamerToken](interfaces/StreamerToken.md) +- [ViewerToken](interfaces/ViewerToken.md) +- [AgentCallbacks](type-aliases/AgentCallbacks.md) +- [AgentEvents](type-aliases/AgentEvents.md) +- [AgentTrack](type-aliases/AgentTrack.md) +- [AudioCodecParameters](type-aliases/AudioCodecParameters.md) +- [Brand](type-aliases/Brand.md) +- [CloseEventHandler](type-aliases/CloseEventHandler.md) +- [ErrorEventHandler](type-aliases/ErrorEventHandler.md) +- [ExpectedAgentEvents](type-aliases/ExpectedAgentEvents.md) +- [ExpectedEvents](type-aliases/ExpectedEvents.md) +- [FishjamConfig](type-aliases/FishjamConfig.md) +- [IncomingTrackData](type-aliases/IncomingTrackData.md) +- [NotificationEvents](type-aliases/NotificationEvents.md) +- [OutgoingTrackData](type-aliases/OutgoingTrackData.md) +- [Peer](type-aliases/Peer.md) +- [PeerAdded](type-aliases/PeerAdded.md) +- [PeerConnected](type-aliases/PeerConnected.md) +- [PeerCrashed](type-aliases/PeerCrashed.md) +- [PeerDeleted](type-aliases/PeerDeleted.md) +- [PeerDisconnected](type-aliases/PeerDisconnected.md) +- [PeerId](type-aliases/PeerId.md) +- [PeerMetadataUpdated](type-aliases/PeerMetadataUpdated.md) +- [PeerOptions](type-aliases/PeerOptions.md) +- [Room](type-aliases/Room.md) +- [RoomCrashed](type-aliases/RoomCrashed.md) +- [RoomCreated](type-aliases/RoomCreated.md) +- [RoomDeleted](type-aliases/RoomDeleted.md) +- [RoomId](type-aliases/RoomId.md) +- [StreamConnected](type-aliases/StreamConnected.md) +- [StreamDisconnected](type-aliases/StreamDisconnected.md) +- [TrackAdded](type-aliases/TrackAdded.md) +- [TrackId](type-aliases/TrackId.md) +- [TrackMetadataUpdated](type-aliases/TrackMetadataUpdated.md) +- [TrackRemoved](type-aliases/TrackRemoved.md) +- [TrackType](type-aliases/TrackType.md) +- [ViewerConnected](type-aliases/ViewerConnected.md) +- [ViewerDisconnected](type-aliases/ViewerDisconnected.md) +- [ServerMessage](variables/ServerMessage.md) diff --git a/versioned_docs/version-0.25.0/api/server/interfaces/PeerOptionsAgent.md b/versioned_docs/version-0.25.0/api/server/interfaces/PeerOptionsAgent.md new file mode 100644 index 00000000..08858b3a --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/interfaces/PeerOptionsAgent.md @@ -0,0 +1,33 @@ +# Interface: PeerOptionsAgent + +Defined in: fishjam-openapi/dist/index.d.ts:297 + +Options specific to the Agent peer + +## Export + +PeerOptionsAgent + +## Properties + +### output? + +> `optional` **output**: `AgentOutput` + +Defined in: fishjam-openapi/dist/index.d.ts:303 + +#### Memberof + +PeerOptionsAgent + +*** + +### subscribeMode? + +> `optional` **subscribeMode**: `SubscribeMode` + +Defined in: fishjam-openapi/dist/index.d.ts:309 + +#### Memberof + +PeerOptionsAgent diff --git a/versioned_docs/version-0.25.0/api/server/interfaces/PeerOptionsWebRTC.md b/versioned_docs/version-0.25.0/api/server/interfaces/PeerOptionsWebRTC.md new file mode 100644 index 00000000..481dc84f --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/interfaces/PeerOptionsWebRTC.md @@ -0,0 +1,39 @@ +# Interface: PeerOptionsWebRTC + +Defined in: fishjam-openapi/dist/index.d.ts:316 + +Options specific to the WebRTC peer + +## Export + +PeerOptionsWebRTC + +## Properties + +### metadata? + +> `optional` **metadata**: `object` + +Defined in: fishjam-openapi/dist/index.d.ts:322 + +Custom peer metadata + +#### Index Signature + +\[`key`: `string`\]: `any` + +#### Memberof + +PeerOptionsWebRTC + +*** + +### subscribeMode? + +> `optional` **subscribeMode**: `SubscribeMode` + +Defined in: fishjam-openapi/dist/index.d.ts:330 + +#### Memberof + +PeerOptionsWebRTC diff --git a/versioned_docs/version-0.25.0/api/server/interfaces/RoomConfig.md b/versioned_docs/version-0.25.0/api/server/interfaces/RoomConfig.md new file mode 100644 index 00000000..63061895 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/interfaces/RoomConfig.md @@ -0,0 +1,75 @@ +# Interface: RoomConfig + +Defined in: fishjam-openapi/dist/index.d.ts:408 + +Room configuration + +## Export + +RoomConfig + +## Properties + +### maxPeers? + +> `optional` **maxPeers**: `null` \| `number` + +Defined in: fishjam-openapi/dist/index.d.ts:414 + +Maximum amount of peers allowed into the room + +#### Memberof + +RoomConfig + +*** + +### public? + +> `optional` **public**: `boolean` + +Defined in: fishjam-openapi/dist/index.d.ts:420 + +True if livestream viewers can omit specifying a token. + +#### Memberof + +RoomConfig + +*** + +### roomType? + +> `optional` **roomType**: [`RoomType`](../enumerations/RoomType.md) + +Defined in: fishjam-openapi/dist/index.d.ts:426 + +#### Memberof + +RoomConfig + +*** + +### videoCodec? + +> `optional` **videoCodec**: [`VideoCodec`](../enumerations/VideoCodec.md) + +Defined in: fishjam-openapi/dist/index.d.ts:432 + +#### Memberof + +RoomConfig + +*** + +### webhookUrl? + +> `optional` **webhookUrl**: `null` \| `string` + +Defined in: fishjam-openapi/dist/index.d.ts:438 + +URL where Fishjam notifications will be sent + +#### Memberof + +RoomConfig diff --git a/versioned_docs/version-0.25.0/api/server/interfaces/ServerMessage.md b/versioned_docs/version-0.25.0/api/server/interfaces/ServerMessage.md new file mode 100644 index 00000000..afbdf3b0 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/interfaces/ServerMessage.md @@ -0,0 +1,217 @@ +# Interface: ServerMessage + +Defined in: fishjam-proto/dist/index.d.ts:63 + +Defines any type of message passed between FJ and server peer + +## Properties + +### authenticated? + +> `optional` **authenticated**: `ServerMessage_Authenticated` + +Defined in: fishjam-proto/dist/index.d.ts:69 + +*** + +### authRequest? + +> `optional` **authRequest**: `ServerMessage_AuthRequest` + +Defined in: fishjam-proto/dist/index.d.ts:70 + +*** + +### componentCrashed? + +> `optional` **componentCrashed**: `ServerMessage_ComponentCrashed` + +Defined in: fishjam-proto/dist/index.d.ts:68 + +*** + +### hlsPlayable? + +> `optional` **hlsPlayable**: `ServerMessage_HlsPlayable` + +Defined in: fishjam-proto/dist/index.d.ts:75 + +*** + +### hlsUploadCrashed? + +> `optional` **hlsUploadCrashed**: `ServerMessage_HlsUploadCrashed` + +Defined in: fishjam-proto/dist/index.d.ts:77 + +*** + +### hlsUploaded? + +> `optional` **hlsUploaded**: `ServerMessage_HlsUploaded` + +Defined in: fishjam-proto/dist/index.d.ts:76 + +*** + +### peerAdded? + +> `optional` **peerAdded**: `ServerMessage_PeerAdded` + +Defined in: fishjam-proto/dist/index.d.ts:82 + +*** + +### peerConnected? + +> `optional` **peerConnected**: `ServerMessage_PeerConnected` + +Defined in: fishjam-proto/dist/index.d.ts:65 + +*** + +### peerCrashed? + +> `optional` **peerCrashed**: `ServerMessage_PeerCrashed` + +Defined in: fishjam-proto/dist/index.d.ts:67 + +*** + +### peerDeleted? + +> `optional` **peerDeleted**: `ServerMessage_PeerDeleted` + +Defined in: fishjam-proto/dist/index.d.ts:83 + +*** + +### peerDisconnected? + +> `optional` **peerDisconnected**: `ServerMessage_PeerDisconnected` + +Defined in: fishjam-proto/dist/index.d.ts:66 + +*** + +### peerMetadataUpdated? + +> `optional` **peerMetadataUpdated**: `ServerMessage_PeerMetadataUpdated` + +Defined in: fishjam-proto/dist/index.d.ts:78 + +*** + +### roomCrashed? + +> `optional` **roomCrashed**: `ServerMessage_RoomCrashed` + +Defined in: fishjam-proto/dist/index.d.ts:64 + +*** + +### roomCreated? + +> `optional` **roomCreated**: `ServerMessage_RoomCreated` + +Defined in: fishjam-proto/dist/index.d.ts:73 + +*** + +### roomDeleted? + +> `optional` **roomDeleted**: `ServerMessage_RoomDeleted` + +Defined in: fishjam-proto/dist/index.d.ts:74 + +*** + +### ~~streamConnected?~~ + +> `optional` **streamConnected**: `ServerMessage_StreamConnected` + +Defined in: fishjam-proto/dist/index.d.ts:85 + +#### Deprecated + +*** + +### ~~streamDisconnected?~~ + +> `optional` **streamDisconnected**: `ServerMessage_StreamDisconnected` + +Defined in: fishjam-proto/dist/index.d.ts:87 + +#### Deprecated + +*** + +### streamerConnected? + +> `optional` **streamerConnected**: `ServerMessage_StreamerConnected` + +Defined in: fishjam-proto/dist/index.d.ts:90 + +*** + +### streamerDisconnected? + +> `optional` **streamerDisconnected**: `ServerMessage_StreamerDisconnected` + +Defined in: fishjam-proto/dist/index.d.ts:91 + +*** + +### subscribeRequest? + +> `optional` **subscribeRequest**: `ServerMessage_SubscribeRequest` + +Defined in: fishjam-proto/dist/index.d.ts:71 + +*** + +### subscribeResponse? + +> `optional` **subscribeResponse**: `ServerMessage_SubscribeResponse` + +Defined in: fishjam-proto/dist/index.d.ts:72 + +*** + +### trackAdded? + +> `optional` **trackAdded**: `ServerMessage_TrackAdded` + +Defined in: fishjam-proto/dist/index.d.ts:79 + +*** + +### trackMetadataUpdated? + +> `optional` **trackMetadataUpdated**: `ServerMessage_TrackMetadataUpdated` + +Defined in: fishjam-proto/dist/index.d.ts:81 + +*** + +### trackRemoved? + +> `optional` **trackRemoved**: `ServerMessage_TrackRemoved` + +Defined in: fishjam-proto/dist/index.d.ts:80 + +*** + +### viewerConnected? + +> `optional` **viewerConnected**: `ServerMessage_ViewerConnected` + +Defined in: fishjam-proto/dist/index.d.ts:88 + +*** + +### viewerDisconnected? + +> `optional` **viewerDisconnected**: `ServerMessage_ViewerDisconnected` + +Defined in: fishjam-proto/dist/index.d.ts:89 diff --git a/versioned_docs/version-0.25.0/api/server/interfaces/StreamerToken.md b/versioned_docs/version-0.25.0/api/server/interfaces/StreamerToken.md new file mode 100644 index 00000000..6e9e9bd4 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/interfaces/StreamerToken.md @@ -0,0 +1,21 @@ +# Interface: StreamerToken + +Defined in: fishjam-openapi/dist/index.d.ts:609 + +Token for authorizing broadcaster streamer connection + +## Export + +StreamerToken + +## Properties + +### token + +> **token**: `string` + +Defined in: fishjam-openapi/dist/index.d.ts:615 + +#### Memberof + +StreamerToken diff --git a/versioned_docs/version-0.25.0/api/server/interfaces/ViewerToken.md b/versioned_docs/version-0.25.0/api/server/interfaces/ViewerToken.md new file mode 100644 index 00000000..ce4c9d12 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/interfaces/ViewerToken.md @@ -0,0 +1,21 @@ +# Interface: ViewerToken + +Defined in: fishjam-openapi/dist/index.d.ts:752 + +Token for authorizing broadcaster viewer connection + +## Export + +ViewerToken + +## Properties + +### token + +> **token**: `string` + +Defined in: fishjam-openapi/dist/index.d.ts:758 + +#### Memberof + +ViewerToken diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/AgentCallbacks.md b/versioned_docs/version-0.25.0/api/server/type-aliases/AgentCallbacks.md new file mode 100644 index 00000000..f7c78dd5 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/AgentCallbacks.md @@ -0,0 +1,21 @@ +# Type Alias: AgentCallbacks + +> **AgentCallbacks** = `object` + +Defined in: [js-server-sdk/src/types.ts:46](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L46) + +## Properties + +### onClose? + +> `optional` **onClose**: [`CloseEventHandler`](CloseEventHandler.md) + +Defined in: [js-server-sdk/src/types.ts:48](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L48) + +*** + +### onError? + +> `optional` **onError**: [`ErrorEventHandler`](ErrorEventHandler.md) + +Defined in: [js-server-sdk/src/types.ts:47](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L47) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/AgentEvents.md b/versioned_docs/version-0.25.0/api/server/type-aliases/AgentEvents.md new file mode 100644 index 00000000..0e76c789 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/AgentEvents.md @@ -0,0 +1,5 @@ +# Type Alias: AgentEvents + +> **AgentEvents** = `{ [K in ExpectedAgentEvents]: (message: NonNullable<{ authenticated?: AgentResponse_Authenticated; trackData?: Omit & { peerId: PeerId } }[K]>) => void }` + +Defined in: [js-server-sdk/src/agent.ts:40](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L40) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/AgentTrack.md b/versioned_docs/version-0.25.0/api/server/type-aliases/AgentTrack.md new file mode 100644 index 00000000..8a2ba880 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/AgentTrack.md @@ -0,0 +1,11 @@ +# Type Alias: AgentTrack + +> **AgentTrack** = `Omit`\<`ProtoTrack`, `"id"`\> & `object` + +Defined in: [js-server-sdk/src/agent.ts:26](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L26) + +## Type declaration + +### id + +> **id**: [`TrackId`](TrackId.md) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/AudioCodecParameters.md b/versioned_docs/version-0.25.0/api/server/type-aliases/AudioCodecParameters.md new file mode 100644 index 00000000..5c999672 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/AudioCodecParameters.md @@ -0,0 +1,29 @@ +# Type Alias: AudioCodecParameters + +> **AudioCodecParameters** = `object` + +Defined in: [js-server-sdk/src/agent.ts:29](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L29) + +## Properties + +### channels + +> **channels**: `1` + +Defined in: [js-server-sdk/src/agent.ts:32](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L32) + +*** + +### encoding + +> **encoding**: `"opus"` \| `"pcm16"` + +Defined in: [js-server-sdk/src/agent.ts:30](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L30) + +*** + +### sampleRate + +> **sampleRate**: `16000` \| `24000` \| `48000` + +Defined in: [js-server-sdk/src/agent.ts:31](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L31) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/Brand.md b/versioned_docs/version-0.25.0/api/server/type-aliases/Brand.md new file mode 100644 index 00000000..109fb2f4 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/Brand.md @@ -0,0 +1,20 @@ +# Type Alias: Brand\ + +> **Brand**\<`T`, `TBrand`\> = `T` & `object` + +Defined in: [js-server-sdk/src/types.ts:8](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L8) + +Branded type helper + +## Type declaration + +### \[brand\] + +> **\[brand\]**: `TBrand` + +## Type Parameters + +| Type Parameter | +| ------ | +| `T` | +| `TBrand` *extends* `string` | diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/CloseEventHandler.md b/versioned_docs/version-0.25.0/api/server/type-aliases/CloseEventHandler.md new file mode 100644 index 00000000..2e43d92d --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/CloseEventHandler.md @@ -0,0 +1,16 @@ +# Type Alias: CloseEventHandler() + +> **CloseEventHandler** = (`code`, `reason`) => `void` + +Defined in: [js-server-sdk/src/types.ts:44](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L44) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `code` | `number` | +| `reason` | `string` | + +## Returns + +`void` diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/ErrorEventHandler.md b/versioned_docs/version-0.25.0/api/server/type-aliases/ErrorEventHandler.md new file mode 100644 index 00000000..fda86af5 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/ErrorEventHandler.md @@ -0,0 +1,15 @@ +# Type Alias: ErrorEventHandler() + +> **ErrorEventHandler** = (`msg`) => `void` + +Defined in: [js-server-sdk/src/types.ts:43](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L43) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `msg` | `Event` | + +## Returns + +`void` diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/ExpectedAgentEvents.md b/versioned_docs/version-0.25.0/api/server/type-aliases/ExpectedAgentEvents.md new file mode 100644 index 00000000..2e1ca318 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/ExpectedAgentEvents.md @@ -0,0 +1,5 @@ +# Type Alias: ExpectedAgentEvents + +> **ExpectedAgentEvents** = `"trackData"` + +Defined in: [js-server-sdk/src/agent.ts:21](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L21) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/ExpectedEvents.md b/versioned_docs/version-0.25.0/api/server/type-aliases/ExpectedEvents.md new file mode 100644 index 00000000..86054f44 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/ExpectedEvents.md @@ -0,0 +1,5 @@ +# Type Alias: ExpectedEvents + +> **ExpectedEvents** = `"roomCreated"` \| `"roomDeleted"` \| `"roomCrashed"` \| `"peerAdded"` \| `"peerDeleted"` \| `"peerConnected"` \| `"peerDisconnected"` \| `"peerMetadataUpdated"` \| `"peerCrashed"` \| `"streamConnected"` \| `"streamDisconnected"` \| `"viewerConnected"` \| `"viewerDisconnected"` \| `"trackAdded"` \| `"trackRemoved"` \| `"trackMetadataUpdated"` + +Defined in: [js-server-sdk/src/ws\_notifier.ts:7](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L7) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/FishjamConfig.md b/versioned_docs/version-0.25.0/api/server/type-aliases/FishjamConfig.md new file mode 100644 index 00000000..2cbde77d --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/FishjamConfig.md @@ -0,0 +1,21 @@ +# Type Alias: FishjamConfig + +> **FishjamConfig** = `object` + +Defined in: [js-server-sdk/src/types.ts:28](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L28) + +## Properties + +### fishjamId + +> **fishjamId**: `string` + +Defined in: [js-server-sdk/src/types.ts:33](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L33) + +*** + +### managementToken + +> **managementToken**: `string` + +Defined in: [js-server-sdk/src/types.ts:39](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L39) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/IncomingTrackData.md b/versioned_docs/version-0.25.0/api/server/type-aliases/IncomingTrackData.md new file mode 100644 index 00000000..76108941 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/IncomingTrackData.md @@ -0,0 +1,11 @@ +# Type Alias: IncomingTrackData + +> **IncomingTrackData** = `Omit`\<`NonNullable`\<`AgentResponse_TrackData`\>, `"peerId"`\> & `object` + +Defined in: [js-server-sdk/src/agent.ts:23](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L23) + +## Type declaration + +### peerId + +> **peerId**: [`PeerId`](PeerId.md) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/NotificationEvents.md b/versioned_docs/version-0.25.0/api/server/type-aliases/NotificationEvents.md new file mode 100644 index 00000000..f39e2eaa --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/NotificationEvents.md @@ -0,0 +1,5 @@ +# Type Alias: NotificationEvents + +> **NotificationEvents** = `{ [K in ExpectedEvents]: (message: NonNullable<{ authenticated?: ServerMessage_Authenticated; authRequest?: ServerMessage_AuthRequest; componentCrashed?: Omit & { roomId: RoomId }; hlsPlayable?: Omit & { roomId: RoomId }; hlsUploadCrashed?: Omit & { roomId: RoomId }; hlsUploaded?: Omit & { roomId: RoomId }; peerAdded?: Omit & { roomId: RoomId }, "peerId"> & { peerId: PeerId }; peerConnected?: Omit & { roomId: RoomId }, "peerId"> & { peerId: PeerId }; peerCrashed?: Omit & { roomId: RoomId }, "peerId"> & { peerId: PeerId }; peerDeleted?: Omit & { roomId: RoomId }, "peerId"> & { peerId: PeerId }; peerDisconnected?: Omit & { roomId: RoomId }, "peerId"> & { peerId: PeerId }; peerMetadataUpdated?: Omit & { roomId: RoomId }, "peerId"> & { peerId: PeerId }; roomCrashed?: Omit & { roomId: RoomId }; roomCreated?: Omit & { roomId: RoomId }; roomDeleted?: Omit & { roomId: RoomId }; streamConnected?: ServerMessage_StreamConnected; streamDisconnected?: ServerMessage_StreamDisconnected; streamerConnected?: ServerMessage_StreamerConnected; streamerDisconnected?: ServerMessage_StreamerDisconnected; subscribeRequest?: ServerMessage_SubscribeRequest; subscribeResponse?: ServerMessage_SubscribeResponse; trackAdded?: Omit & { roomId: RoomId }; trackMetadataUpdated?: Omit & { roomId: RoomId }; trackRemoved?: Omit & { roomId: RoomId }; viewerConnected?: ServerMessage_ViewerConnected; viewerDisconnected?: ServerMessage_ViewerDisconnected }[K]>) => void }` + +Defined in: [js-server-sdk/src/ws\_notifier.ts:70](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L70) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/OutgoingTrackData.md b/versioned_docs/version-0.25.0/api/server/type-aliases/OutgoingTrackData.md new file mode 100644 index 00000000..c3ca225a --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/OutgoingTrackData.md @@ -0,0 +1,11 @@ +# Type Alias: OutgoingTrackData + +> **OutgoingTrackData** = `Omit`\<`NonNullable`\<`AgentRequest_TrackData`\>, `"peerId"`\> & `object` + +Defined in: [js-server-sdk/src/agent.ts:24](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L24) + +## Type declaration + +### peerId + +> **peerId**: [`PeerId`](PeerId.md) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/Peer.md b/versioned_docs/version-0.25.0/api/server/type-aliases/Peer.md new file mode 100644 index 00000000..8855fb69 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/Peer.md @@ -0,0 +1,11 @@ +# Type Alias: Peer + +> **Peer** = `Omit`\<`OpenApiPeer`, `"id"`\> & `object` + +Defined in: [js-server-sdk/src/types.ts:20](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L20) + +## Type declaration + +### id + +> **id**: [`PeerId`](PeerId.md) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/PeerAdded.md b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerAdded.md new file mode 100644 index 00000000..462fb5ff --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerAdded.md @@ -0,0 +1,5 @@ +# Type Alias: PeerAdded + +> **PeerAdded** = `object`\[`"peerAdded"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:37](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L37) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/PeerConnected.md b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerConnected.md new file mode 100644 index 00000000..e7bb7afd --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerConnected.md @@ -0,0 +1,5 @@ +# Type Alias: PeerConnected + +> **PeerConnected** = `object`\[`"peerConnected"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:39](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L39) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/PeerCrashed.md b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerCrashed.md new file mode 100644 index 00000000..88b79751 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerCrashed.md @@ -0,0 +1,5 @@ +# Type Alias: PeerCrashed + +> **PeerCrashed** = `object`\[`"peerCrashed"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:42](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L42) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/PeerDeleted.md b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerDeleted.md new file mode 100644 index 00000000..3b17e315 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerDeleted.md @@ -0,0 +1,5 @@ +# Type Alias: PeerDeleted + +> **PeerDeleted** = `object`\[`"peerDeleted"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:38](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L38) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/PeerDisconnected.md b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerDisconnected.md new file mode 100644 index 00000000..91f1f95d --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerDisconnected.md @@ -0,0 +1,5 @@ +# Type Alias: PeerDisconnected + +> **PeerDisconnected** = `object`\[`"peerDisconnected"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:40](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L40) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/PeerId.md b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerId.md new file mode 100644 index 00000000..e20afb19 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerId.md @@ -0,0 +1,7 @@ +# Type Alias: PeerId + +> **PeerId** = [`Brand`](Brand.md)\<`string`, `"PeerId"`\> + +Defined in: [js-server-sdk/src/types.ts:18](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L18) + +ID of Peer. Peer is associated with Room and can be created with [FishjamClient.createPeer](../classes/FishjamClient.md#createpeer). diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/PeerMetadataUpdated.md b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerMetadataUpdated.md new file mode 100644 index 00000000..e4d5dcac --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerMetadataUpdated.md @@ -0,0 +1,5 @@ +# Type Alias: PeerMetadataUpdated + +> **PeerMetadataUpdated** = `object`\[`"peerMetadataUpdated"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:41](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L41) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/PeerOptions.md b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerOptions.md new file mode 100644 index 00000000..9c901fe6 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/PeerOptions.md @@ -0,0 +1,7 @@ +# Type Alias: PeerOptions + +> **PeerOptions** = [`PeerOptionsAgent`](../interfaces/PeerOptionsAgent.md) \| [`PeerOptionsWebRTC`](../interfaces/PeerOptionsWebRTC.md) + +Defined in: fishjam-openapi/dist/index.d.ts:291 + +## Export diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/Room.md b/versioned_docs/version-0.25.0/api/server/type-aliases/Room.md new file mode 100644 index 00000000..d04c2bac --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/Room.md @@ -0,0 +1,29 @@ +# Type Alias: Room + +> **Room** = `object` + +Defined in: [js-server-sdk/src/types.ts:22](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L22) + +## Properties + +### config + +> **config**: [`RoomConfig`](../interfaces/RoomConfig.md) + +Defined in: [js-server-sdk/src/types.ts:25](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L25) + +*** + +### id + +> **id**: [`RoomId`](RoomId.md) + +Defined in: [js-server-sdk/src/types.ts:23](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L23) + +*** + +### peers + +> **peers**: [`Peer`](Peer.md)[] + +Defined in: [js-server-sdk/src/types.ts:24](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L24) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/RoomCrashed.md b/versioned_docs/version-0.25.0/api/server/type-aliases/RoomCrashed.md new file mode 100644 index 00000000..f941c255 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/RoomCrashed.md @@ -0,0 +1,5 @@ +# Type Alias: RoomCrashed + +> **RoomCrashed** = `object`\[`"roomCrashed"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:36](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L36) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/RoomCreated.md b/versioned_docs/version-0.25.0/api/server/type-aliases/RoomCreated.md new file mode 100644 index 00000000..e4494a5d --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/RoomCreated.md @@ -0,0 +1,5 @@ +# Type Alias: RoomCreated + +> **RoomCreated** = `object`\[`"roomCreated"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:34](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L34) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/RoomDeleted.md b/versioned_docs/version-0.25.0/api/server/type-aliases/RoomDeleted.md new file mode 100644 index 00000000..8a3f4d48 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/RoomDeleted.md @@ -0,0 +1,5 @@ +# Type Alias: RoomDeleted + +> **RoomDeleted** = `object`\[`"roomDeleted"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:35](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L35) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/RoomId.md b/versioned_docs/version-0.25.0/api/server/type-aliases/RoomId.md new file mode 100644 index 00000000..d6d3bffa --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/RoomId.md @@ -0,0 +1,8 @@ +# Type Alias: RoomId + +> **RoomId** = [`Brand`](Brand.md)\<`string`, `"RoomId"`\> + +Defined in: [js-server-sdk/src/types.ts:14](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/types.ts#L14) + +ID of the Room. +Room can be created with [FishjamClient.createRoom](../classes/FishjamClient.md#createroom). diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/StreamConnected.md b/versioned_docs/version-0.25.0/api/server/type-aliases/StreamConnected.md new file mode 100644 index 00000000..36d9d94a --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/StreamConnected.md @@ -0,0 +1,5 @@ +# Type Alias: StreamConnected + +> **StreamConnected** = `object`\[`"streamConnected"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:43](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L43) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/StreamDisconnected.md b/versioned_docs/version-0.25.0/api/server/type-aliases/StreamDisconnected.md new file mode 100644 index 00000000..b54fb9a2 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/StreamDisconnected.md @@ -0,0 +1,5 @@ +# Type Alias: StreamDisconnected + +> **StreamDisconnected** = `object`\[`"streamDisconnected"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:44](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L44) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/TrackAdded.md b/versioned_docs/version-0.25.0/api/server/type-aliases/TrackAdded.md new file mode 100644 index 00000000..a0a8d730 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/TrackAdded.md @@ -0,0 +1,5 @@ +# Type Alias: TrackAdded + +> **TrackAdded** = `object`\[`"trackAdded"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:47](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L47) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/TrackId.md b/versioned_docs/version-0.25.0/api/server/type-aliases/TrackId.md new file mode 100644 index 00000000..1b1628e4 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/TrackId.md @@ -0,0 +1,5 @@ +# Type Alias: TrackId + +> **TrackId** = [`Brand`](Brand.md)\<`string`, `"TrackId"`\> + +Defined in: [js-server-sdk/src/agent.ts:34](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L34) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/TrackMetadataUpdated.md b/versioned_docs/version-0.25.0/api/server/type-aliases/TrackMetadataUpdated.md new file mode 100644 index 00000000..3657d79a --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/TrackMetadataUpdated.md @@ -0,0 +1,5 @@ +# Type Alias: TrackMetadataUpdated + +> **TrackMetadataUpdated** = `object`\[`"trackMetadataUpdated"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:49](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L49) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/TrackRemoved.md b/versioned_docs/version-0.25.0/api/server/type-aliases/TrackRemoved.md new file mode 100644 index 00000000..8d2a1c57 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/TrackRemoved.md @@ -0,0 +1,5 @@ +# Type Alias: TrackRemoved + +> **TrackRemoved** = `object`\[`"trackRemoved"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:48](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L48) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/TrackType.md b/versioned_docs/version-0.25.0/api/server/type-aliases/TrackType.md new file mode 100644 index 00000000..d79f5c77 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/TrackType.md @@ -0,0 +1,5 @@ +# Type Alias: TrackType + +> **TrackType** = `"audio"` \| `"video"` + +Defined in: [js-server-sdk/src/agent.ts:28](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/agent.ts#L28) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/ViewerConnected.md b/versioned_docs/version-0.25.0/api/server/type-aliases/ViewerConnected.md new file mode 100644 index 00000000..a7d7b2a5 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/ViewerConnected.md @@ -0,0 +1,5 @@ +# Type Alias: ViewerConnected + +> **ViewerConnected** = `object`\[`"viewerConnected"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:45](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L45) diff --git a/versioned_docs/version-0.25.0/api/server/type-aliases/ViewerDisconnected.md b/versioned_docs/version-0.25.0/api/server/type-aliases/ViewerDisconnected.md new file mode 100644 index 00000000..ffdfabd5 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/type-aliases/ViewerDisconnected.md @@ -0,0 +1,5 @@ +# Type Alias: ViewerDisconnected + +> **ViewerDisconnected** = `object`\[`"viewerDisconnected"`\] + +Defined in: [js-server-sdk/src/ws\_notifier.ts:46](https://github.com/fishjam-cloud/js-server-sdk/blob/7aa91272ab7d18fdf42ce6de3cf7585b5d0dd285/packages/js-server-sdk/src/ws_notifier.ts#L46) diff --git a/versioned_docs/version-0.25.0/api/server/typedoc-sidebar.cjs b/versioned_docs/version-0.25.0/api/server/typedoc-sidebar.cjs new file mode 100644 index 00000000..3641eff5 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/typedoc-sidebar.cjs @@ -0,0 +1,4 @@ +// @ts-check +/** @type {import("@docusaurus/plugin-content-docs").SidebarsConfig} */ +const typedocSidebar = {items:[{type:"category",label:"Client",items:[{type:"doc",id:"api/server/classes/FishjamClient",label:"FishjamClient"},{type:"doc",id:"api/server/classes/FishjamWSNotifier",label:"FishjamWSNotifier"}]},{type:"category",label:"Other",items:[{type:"doc",id:"api/server/enumerations/PeerStatus",label:"PeerStatus"},{type:"doc",id:"api/server/enumerations/RoomType",label:"RoomType"},{type:"doc",id:"api/server/enumerations/VideoCodec",label:"VideoCodec"},{type:"doc",id:"api/server/classes/BadRequestException",label:"BadRequestException"},{type:"doc",id:"api/server/classes/FishjamAgent",label:"FishjamAgent"},{type:"doc",id:"api/server/classes/FishjamBaseException",label:"FishjamBaseException"},{type:"doc",id:"api/server/classes/FishjamNotFoundException",label:"FishjamNotFoundException"},{type:"doc",id:"api/server/classes/ForbiddenException",label:"ForbiddenException"},{type:"doc",id:"api/server/classes/MissingFishjamIdException",label:"MissingFishjamIdException"},{type:"doc",id:"api/server/classes/PeerNotFoundException",label:"PeerNotFoundException"},{type:"doc",id:"api/server/classes/RoomNotFoundException",label:"RoomNotFoundException"},{type:"doc",id:"api/server/classes/ServiceUnavailableException",label:"ServiceUnavailableException"},{type:"doc",id:"api/server/classes/UnauthorizedException",label:"UnauthorizedException"},{type:"doc",id:"api/server/classes/UnknownException",label:"UnknownException"},{type:"doc",id:"api/server/interfaces/PeerOptionsAgent",label:"PeerOptionsAgent"},{type:"doc",id:"api/server/interfaces/PeerOptionsWebRTC",label:"PeerOptionsWebRTC"},{type:"doc",id:"api/server/interfaces/RoomConfig",label:"RoomConfig"},{type:"doc",id:"api/server/interfaces/ServerMessage",label:"ServerMessage"},{type:"doc",id:"api/server/interfaces/StreamerToken",label:"StreamerToken"},{type:"doc",id:"api/server/interfaces/ViewerToken",label:"ViewerToken"},{type:"doc",id:"api/server/type-aliases/AgentCallbacks",label:"AgentCallbacks"},{type:"doc",id:"api/server/type-aliases/AgentEvents",label:"AgentEvents"},{type:"doc",id:"api/server/type-aliases/AgentTrack",label:"AgentTrack"},{type:"doc",id:"api/server/type-aliases/AudioCodecParameters",label:"AudioCodecParameters"},{type:"doc",id:"api/server/type-aliases/Brand",label:"Brand"},{type:"doc",id:"api/server/type-aliases/CloseEventHandler",label:"CloseEventHandler"},{type:"doc",id:"api/server/type-aliases/ErrorEventHandler",label:"ErrorEventHandler"},{type:"doc",id:"api/server/type-aliases/ExpectedAgentEvents",label:"ExpectedAgentEvents"},{type:"doc",id:"api/server/type-aliases/ExpectedEvents",label:"ExpectedEvents"},{type:"doc",id:"api/server/type-aliases/FishjamConfig",label:"FishjamConfig"},{type:"doc",id:"api/server/type-aliases/IncomingTrackData",label:"IncomingTrackData"},{type:"doc",id:"api/server/type-aliases/NotificationEvents",label:"NotificationEvents"},{type:"doc",id:"api/server/type-aliases/OutgoingTrackData",label:"OutgoingTrackData"},{type:"doc",id:"api/server/type-aliases/Peer",label:"Peer"},{type:"doc",id:"api/server/type-aliases/PeerAdded",label:"PeerAdded"},{type:"doc",id:"api/server/type-aliases/PeerConnected",label:"PeerConnected"},{type:"doc",id:"api/server/type-aliases/PeerCrashed",label:"PeerCrashed"},{type:"doc",id:"api/server/type-aliases/PeerDeleted",label:"PeerDeleted"},{type:"doc",id:"api/server/type-aliases/PeerDisconnected",label:"PeerDisconnected"},{type:"doc",id:"api/server/type-aliases/PeerId",label:"PeerId"},{type:"doc",id:"api/server/type-aliases/PeerMetadataUpdated",label:"PeerMetadataUpdated"},{type:"doc",id:"api/server/type-aliases/PeerOptions",label:"PeerOptions"},{type:"doc",id:"api/server/type-aliases/Room",label:"Room"},{type:"doc",id:"api/server/type-aliases/RoomCrashed",label:"RoomCrashed"},{type:"doc",id:"api/server/type-aliases/RoomCreated",label:"RoomCreated"},{type:"doc",id:"api/server/type-aliases/RoomDeleted",label:"RoomDeleted"},{type:"doc",id:"api/server/type-aliases/RoomId",label:"RoomId"},{type:"doc",id:"api/server/type-aliases/StreamConnected",label:"StreamConnected"},{type:"doc",id:"api/server/type-aliases/StreamDisconnected",label:"StreamDisconnected"},{type:"doc",id:"api/server/type-aliases/TrackAdded",label:"TrackAdded"},{type:"doc",id:"api/server/type-aliases/TrackId",label:"TrackId"},{type:"doc",id:"api/server/type-aliases/TrackMetadataUpdated",label:"TrackMetadataUpdated"},{type:"doc",id:"api/server/type-aliases/TrackRemoved",label:"TrackRemoved"},{type:"doc",id:"api/server/type-aliases/TrackType",label:"TrackType"},{type:"doc",id:"api/server/type-aliases/ViewerConnected",label:"ViewerConnected"},{type:"doc",id:"api/server/type-aliases/ViewerDisconnected",label:"ViewerDisconnected"},{type:"doc",id:"api/server/variables/ServerMessage",label:"ServerMessage"}]}]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/versioned_docs/version-0.25.0/api/server/variables/ServerMessage.md b/versioned_docs/version-0.25.0/api/server/variables/ServerMessage.md new file mode 100644 index 00000000..e1bb44b2 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/server/variables/ServerMessage.md @@ -0,0 +1,5 @@ +# Variable: ServerMessage + +> **ServerMessage**: `MessageFns$1`\<[`ServerMessage`](../interfaces/ServerMessage.md)\> + +Defined in: fishjam-proto/dist/index.d.ts:63 diff --git a/versioned_docs/version-0.25.0/api/web/enumerations/Variant.md b/versioned_docs/version-0.25.0/api/web/enumerations/Variant.md new file mode 100644 index 00000000..3b02b3e1 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/enumerations/Variant.md @@ -0,0 +1,43 @@ +# Enumeration: Variant + +Defined in: ts-client/dist/index.d.mts:18 + +## Enumeration Members + +### UNRECOGNIZED + +> **UNRECOGNIZED**: `-1` + +Defined in: ts-client/dist/index.d.mts:23 + +*** + +### VARIANT\_HIGH + +> **VARIANT\_HIGH**: `3` + +Defined in: ts-client/dist/index.d.mts:22 + +*** + +### VARIANT\_LOW + +> **VARIANT\_LOW**: `1` + +Defined in: ts-client/dist/index.d.mts:20 + +*** + +### VARIANT\_MEDIUM + +> **VARIANT\_MEDIUM**: `2` + +Defined in: ts-client/dist/index.d.mts:21 + +*** + +### VARIANT\_UNSPECIFIED + +> **VARIANT\_UNSPECIFIED**: `0` + +Defined in: ts-client/dist/index.d.mts:19 diff --git a/versioned_docs/version-0.25.0/api/web/functions/FishjamProvider.md b/versioned_docs/version-0.25.0/api/web/functions/FishjamProvider.md new file mode 100644 index 00000000..94fb28f1 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/FishjamProvider.md @@ -0,0 +1,17 @@ +# Function: FishjamProvider() + +> **FishjamProvider**(`props`): `Element` + +Defined in: [react-client/src/FishjamProvider.tsx:74](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L74) + +Provides the Fishjam Context + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `props` | [`FishjamProviderProps`](../interfaces/FishjamProviderProps.md) | + +## Returns + +`Element` diff --git a/versioned_docs/version-0.25.0/api/web/functions/useCamera.md b/versioned_docs/version-0.25.0/api/web/functions/useCamera.md new file mode 100644 index 00000000..a07ed63d --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useCamera.md @@ -0,0 +1,122 @@ +# Function: useCamera() + +> **useCamera**(): `object` + +Defined in: [react-client/src/hooks/devices/useCamera.ts:9](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/devices/useCamera.ts#L9) + +This hook can toggle camera on/off, change camera, provides current camera and other. + +## Returns + +### ~~activeCamera~~ + +> **activeCamera**: `null` \| [`DeviceItem`](../type-aliases/DeviceItem.md) = `cameraManager.activeDevice` + +#### Deprecated + +Use `currentCamera` and `isCameraOn` instead +Indicates which camera is now turned on and streaming + +### cameraDeviceError + +> **cameraDeviceError**: `null` \| [`DeviceError`](../type-aliases/DeviceError.md) = `cameraManager.deviceError` + +Possible error thrown while setting up the camera + +### cameraDevices + +> **cameraDevices**: [`DeviceItem`](../type-aliases/DeviceItem.md)[] = `cameraManager.deviceList` + +List of available camera devices + +### cameraStream + +> **cameraStream**: `null` \| `MediaStream` + +The MediaStream object containing the current stream + +### currentCamera + +> **currentCamera**: `null` \| `MediaDeviceInfo` = `cameraManager.selectedDevice` + +Indicates which camera is now selected + +### currentCameraMiddleware + +> **currentCameraMiddleware**: [`TrackMiddleware`](../type-aliases/TrackMiddleware.md) = `videoTrackManager.currentMiddleware` + +The currently set camera middleware function + +### isCameraOn + +> **isCameraOn**: `boolean` = `!!cameraStream` + +Indicates whether the camera is streaming video + +### selectCamera() + +> **selectCamera**: (`deviceId`) => `Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> = `videoTrackManager.selectDevice` + +Selects the camera device + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `deviceId` | `string` | + +#### Returns + +`Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> + +### setCameraTrackMiddleware() + +> **setCameraTrackMiddleware**: (`middleware`) => `Promise`\<`void`\> = `videoTrackManager.setTrackMiddleware` + +Sets the camera middleware + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `middleware` | [`TrackMiddleware`](../type-aliases/TrackMiddleware.md) | + +#### Returns + +`Promise`\<`void`\> + +### startCamera() + +> **startCamera**: (`deviceId?`) => `Promise`\<\[`MediaStreamTrack`, `null`\] \| \[`null`, [`DeviceError`](../type-aliases/DeviceError.md)\]\> = `videoTrackManager.startDevice` + +Starts the camera + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `deviceId?` | `null` \| `string` | + +#### Returns + +`Promise`\<\[`MediaStreamTrack`, `null`\] \| \[`null`, [`DeviceError`](../type-aliases/DeviceError.md)\]\> + +### stopCamera() + +> **stopCamera**: () => `void` = `videoTrackManager.stopDevice` + +Stops the camera + +#### Returns + +`void` + +### toggleCamera() + +> **toggleCamera**: () => `Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> = `videoTrackManager.toggleDevice` + +Toggles current camera on/off + +#### Returns + +`Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> diff --git a/versioned_docs/version-0.25.0/api/web/functions/useConnection.md b/versioned_docs/version-0.25.0/api/web/functions/useConnection.md new file mode 100644 index 00000000..ff2eddd5 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useConnection.md @@ -0,0 +1,53 @@ +# Function: useConnection() + +> **useConnection**(): `object` + +Defined in: [react-client/src/hooks/useConnection.ts:26](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useConnection.ts#L26) + +Hook allows to join or leave a room and check the current connection status. + +## Returns + +### joinRoom() + +> **joinRoom**: \<`PeerMetadata`\>(`__namedParameters`) => `Promise`\<`void`\> + +Join room and start streaming camera and microphone + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `PeerMetadata` *extends* `GenericMetadata` | `GenericMetadata` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `__namedParameters` | [`JoinRoomConfig`](../interfaces/JoinRoomConfig.md)\<`PeerMetadata`\> | + +#### Returns + +`Promise`\<`void`\> + +### leaveRoom() + +> **leaveRoom**: () => `void` + +Leave room and stop streaming + +#### Returns + +`void` + +### peerStatus + +> **peerStatus**: [`PeerStatus`](../type-aliases/PeerStatus.md) + +Current peer connection status + +### reconnectionStatus + +> **reconnectionStatus**: [`ReconnectionStatus`](../type-aliases/ReconnectionStatus.md) + +Current reconnection status diff --git a/versioned_docs/version-0.25.0/api/web/functions/useCustomSource.md b/versioned_docs/version-0.25.0/api/web/functions/useCustomSource.md new file mode 100644 index 00000000..096866e4 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useCustomSource.md @@ -0,0 +1,44 @@ +# Function: useCustomSource() + +> **useCustomSource**\<`T`\>(`sourceId`): `object` + +Defined in: [react-client/src/hooks/useCustomSource.ts:9](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useCustomSource.ts#L9) + +This hook can register/deregister a custom MediaStream with Fishjam. + +## Type Parameters + +| Type Parameter | +| ------ | +| `T` *extends* `string` | + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `sourceId` | `T` | + +## Returns + +### setStream() + +> **setStream**: (`newStream`) => `Promise`\<`void`\> + +Associates the given stream with the custom source. +This stream will be sent to Fishjam after startStreaming has been called. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `newStream` | `null` \| `MediaStream` | + +#### Returns + +`Promise`\<`void`\> + +### stream + +> **stream**: `undefined` \| `MediaStream` + +The MediaStream currently associated with the custom source diff --git a/versioned_docs/version-0.25.0/api/web/functions/useDataChannel.md b/versioned_docs/version-0.25.0/api/web/functions/useDataChannel.md new file mode 100644 index 00000000..90cdc2a0 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useDataChannel.md @@ -0,0 +1,11 @@ +# Function: useDataChannel() + +> **useDataChannel**(): [`UseDataChannelResult`](../type-aliases/UseDataChannelResult.md) + +Defined in: [react-client/src/hooks/useDataChannel.ts:14](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useDataChannel.ts#L14) + +Hook for data channel operations - publish and subscribe to data. + +## Returns + +[`UseDataChannelResult`](../type-aliases/UseDataChannelResult.md) diff --git a/versioned_docs/version-0.25.0/api/web/functions/useInitializeDevices.md b/versioned_docs/version-0.25.0/api/web/functions/useInitializeDevices.md new file mode 100644 index 00000000..c79eee3f --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useInitializeDevices.md @@ -0,0 +1,25 @@ +# Function: useInitializeDevices() + +> **useInitializeDevices**(): `object` + +Defined in: [react-client/src/hooks/devices/useInitializeDevices.ts:14](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/devices/useInitializeDevices.ts#L14) + +Hook allows you to initialize access to the devices before joining the room. + +## Returns + +### initializeDevices() + +> **initializeDevices**: (`settings?`) => `Promise`\<[`InitializeDevicesResult`](../type-aliases/InitializeDevicesResult.md)\> + +Initialize access to the devices before joining the room + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `settings?` | [`InitializeDevicesSettings`](../type-aliases/InitializeDevicesSettings.md) | + +#### Returns + +`Promise`\<[`InitializeDevicesResult`](../type-aliases/InitializeDevicesResult.md)\> diff --git a/versioned_docs/version-0.25.0/api/web/functions/useLivestreamStreamer.md b/versioned_docs/version-0.25.0/api/web/functions/useLivestreamStreamer.md new file mode 100644 index 00000000..449b4d9f --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useLivestreamStreamer.md @@ -0,0 +1,11 @@ +# Function: useLivestreamStreamer() + +> **useLivestreamStreamer**(): [`UseLivestreamStreamerResult`](../interfaces/UseLivestreamStreamerResult.md) + +Defined in: [react-client/src/hooks/useLivestreamStreamer.ts:52](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamStreamer.ts#L52) + +Hook for publishing a livestream, which can be then received with [useLivestreamViewer](useLivestreamViewer.md) + +## Returns + +[`UseLivestreamStreamerResult`](../interfaces/UseLivestreamStreamerResult.md) diff --git a/versioned_docs/version-0.25.0/api/web/functions/useLivestreamViewer.md b/versioned_docs/version-0.25.0/api/web/functions/useLivestreamViewer.md new file mode 100644 index 00000000..af8c46ee --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useLivestreamViewer.md @@ -0,0 +1,11 @@ +# Function: useLivestreamViewer() + +> **useLivestreamViewer**(): [`UseLivestreamViewerResult`](../interfaces/UseLivestreamViewerResult.md) + +Defined in: [react-client/src/hooks/useLivestreamViewer.ts:42](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamViewer.ts#L42) + +Hook for receiving a published livestream. + +## Returns + +[`UseLivestreamViewerResult`](../interfaces/UseLivestreamViewerResult.md) diff --git a/versioned_docs/version-0.25.0/api/web/functions/useMicrophone.md b/versioned_docs/version-0.25.0/api/web/functions/useMicrophone.md new file mode 100644 index 00000000..b1943feb --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useMicrophone.md @@ -0,0 +1,138 @@ +# Function: useMicrophone() + +> **useMicrophone**(): `object` + +Defined in: [react-client/src/hooks/devices/useMicrophone.ts:9](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/devices/useMicrophone.ts#L9) + +Manage microphone + +## Returns + +### ~~activeMicrophone~~ + +> **activeMicrophone**: `null` \| [`DeviceItem`](../type-aliases/DeviceItem.md) = `microphoneManager.activeDevice` + +#### Deprecated + +Use `currentMicrophone` and `isMicrophoneOn` instead +Indicates which microphone is now turned on and streaming audio + +### currentMicrophone + +> **currentMicrophone**: `null` \| `MediaDeviceInfo` = `microphoneManager.selectedDevice` + +Indicates which microphone is now selected + +### currentMicrophoneMiddleware + +> **currentMicrophoneMiddleware**: [`TrackMiddleware`](../type-aliases/TrackMiddleware.md) = `audioTrackManager.currentMiddleware` + +The currently set microphone middleware function + +### isMicrophoneMuted + +> **isMicrophoneMuted**: `boolean` = `!microphoneManager.deviceEnabled` + +Indicates whether the microphone is muted + +### isMicrophoneOn + +> **isMicrophoneOn**: `boolean` = `!!microphoneStream` + +Indicates whether the microphone is streaming audio + +### microphoneDeviceError + +> **microphoneDeviceError**: `null` \| [`DeviceError`](../type-aliases/DeviceError.md) = `microphoneManager.deviceError` + +Possible error thrown while setting up the microphone + +### microphoneDevices + +> **microphoneDevices**: [`DeviceItem`](../type-aliases/DeviceItem.md)[] = `microphoneManager.deviceList` + +List of available microphone devices + +### microphoneStream + +> **microphoneStream**: `null` \| `MediaStream` + +The MediaStream object containing the current audio stream + +### selectMicrophone() + +> **selectMicrophone**: (`deviceId`) => `Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> = `audioTrackManager.selectDevice` + +Selects the microphone device + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `deviceId` | `string` | + +#### Returns + +`Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> + +### setMicrophoneTrackMiddleware() + +> **setMicrophoneTrackMiddleware**: (`middleware`) => `Promise`\<`void`\> = `audioTrackManager.setTrackMiddleware` + +Sets the microphone middleware + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `middleware` | [`TrackMiddleware`](../type-aliases/TrackMiddleware.md) | + +#### Returns + +`Promise`\<`void`\> + +### startMicrophone() + +> **startMicrophone**: (`deviceId?`) => `Promise`\<\[`MediaStreamTrack`, `null`\] \| \[`null`, [`DeviceError`](../type-aliases/DeviceError.md)\]\> = `audioTrackManager.startDevice` + +Starts the microphone + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `deviceId?` | `null` \| `string` | + +#### Returns + +`Promise`\<\[`MediaStreamTrack`, `null`\] \| \[`null`, [`DeviceError`](../type-aliases/DeviceError.md)\]\> + +### stopMicrophone() + +> **stopMicrophone**: () => `void` = `audioTrackManager.stopDevice` + +Stops the microphone + +#### Returns + +`void` + +### toggleMicrophone() + +> **toggleMicrophone**: () => `Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> = `audioTrackManager.toggleDevice` + +Toggles current microphone on/off + +#### Returns + +`Promise`\<`undefined` \| [`DeviceError`](../type-aliases/DeviceError.md)\> + +### toggleMicrophoneMute() + +> **toggleMicrophoneMute**: () => `Promise`\<`void`\> = `audioTrackManager.toggleMute` + +Mutes/unmutes the microphone + +#### Returns + +`Promise`\<`void`\> diff --git a/versioned_docs/version-0.25.0/api/web/functions/usePeers.md b/versioned_docs/version-0.25.0/api/web/functions/usePeers.md new file mode 100644 index 00000000..5beec452 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/usePeers.md @@ -0,0 +1,39 @@ +# Function: usePeers() + +> **usePeers**\<`PeerMetadata`, `ServerMetadata`\>(): `object` + +Defined in: [react-client/src/hooks/usePeers.ts:67](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L67) + +Hook allows to access id, tracks and metadata of the local and remote peers. + +## Type Parameters + +| Type Parameter | Default type | Description | +| ------ | ------ | ------ | +| `PeerMetadata` | `Record`\<`string`, `unknown`\> | Type of metadata set by peer while connecting to a room. | +| `ServerMetadata` | `Record`\<`string`, `unknown`\> | Type of metadata set by the server while creating a peer. | + +## Returns + +### localPeer + +> **localPeer**: `null` \| [`PeerWithTracks`](../type-aliases/PeerWithTracks.md)\<`PeerMetadata`, `ServerMetadata`\> + +The local peer with distinguished tracks (camera, microphone, screen share). +Will be null if the local peer is not found. + +### ~~peers~~ + +> **peers**: [`PeerWithTracks`](../type-aliases/PeerWithTracks.md)\<`PeerMetadata`, `ServerMetadata`\>[] = `remotePeers` + +#### Deprecated + +Use remotePeers instead +Legacy array containing remote peers. +This property will be removed in future versions. + +### remotePeers + +> **remotePeers**: [`PeerWithTracks`](../type-aliases/PeerWithTracks.md)\<`PeerMetadata`, `ServerMetadata`\>[] + +Array of remote peers with distinguished tracks (camera, microphone, screen share). diff --git a/versioned_docs/version-0.25.0/api/web/functions/useSandbox.md b/versioned_docs/version-0.25.0/api/web/functions/useSandbox.md new file mode 100644 index 00000000..f80e6fe5 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useSandbox.md @@ -0,0 +1,60 @@ +# Function: useSandbox() + +> **useSandbox**(`props?`): `object` + +Defined in: [react-client/src/hooks/useSandbox.ts:19](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useSandbox.ts#L19) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `props?` | [`UseSandboxProps`](../type-aliases/UseSandboxProps.md) | + +## Returns + +`object` + +### getSandboxLivestream() + +> **getSandboxLivestream**: (`roomName`, `isPublic`) => `Promise`\<\{ `room`: \{ `id`: `string`; `name`: `string`; \}; `streamerToken`: `string`; \}\> + +#### Parameters + +| Parameter | Type | Default value | +| ------ | ------ | ------ | +| `roomName` | `string` | `undefined` | +| `isPublic` | `boolean` | `false` | + +#### Returns + +`Promise`\<\{ `room`: \{ `id`: `string`; `name`: `string`; \}; `streamerToken`: `string`; \}\> + +### getSandboxPeerToken() + +> **getSandboxPeerToken**: (`roomName`, `peerName`, `roomType`) => `Promise`\<`string`\> + +#### Parameters + +| Parameter | Type | Default value | +| ------ | ------ | ------ | +| `roomName` | `string` | `undefined` | +| `peerName` | `string` | `undefined` | +| `roomType` | [`RoomType`](../type-aliases/RoomType.md) | `"conference"` | + +#### Returns + +`Promise`\<`string`\> + +### getSandboxViewerToken() + +> **getSandboxViewerToken**: (`roomName`) => `Promise`\<`string`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roomName` | `string` | + +#### Returns + +`Promise`\<`string`\> diff --git a/versioned_docs/version-0.25.0/api/web/functions/useScreenShare.md b/versioned_docs/version-0.25.0/api/web/functions/useScreenShare.md new file mode 100644 index 00000000..0cd3143d --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useScreenShare.md @@ -0,0 +1,81 @@ +# Function: useScreenShare() + +> **useScreenShare**(): `object` + +Defined in: [react-client/src/hooks/useScreenShare.ts:10](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useScreenShare.ts#L10) + +Hook to enable screen sharing within a room and manage the existing stream. + +## Returns + +### audioTrack + +> **audioTrack**: `null` \| `MediaStreamTrack` = `screenShareManager.audioTrack` + +The separate audio MediaStreamTrack. + +### currentTracksMiddleware + +> **currentTracksMiddleware**: `null` \| [`TracksMiddleware`](../type-aliases/TracksMiddleware.md) = `screenShareManager.currentTracksMiddleware` + +The middleware currently assigned to process the tracks. +A screenshare may include both audio and video tracks, and this middleware is capable of processing +each track type. + +### setTracksMiddleware() + +> **setTracksMiddleware**: (`middleware`) => `Promise`\<`void`\> = `screenShareManager.setTracksMiddleware` + +Sets the middleware responsible for processing the tracks. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `middleware` | `null` \| [`TracksMiddleware`](../type-aliases/TracksMiddleware.md) | The middleware to set, which can be a TracksMiddleware instance or null to remove the middleware. | + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves once the middleware is successfully set. + +### startStreaming() + +> **startStreaming**: (`props?`) => `Promise`\<`void`\> = `screenShareManager.startStreaming` + +Invokes the screen sharing prompt in the user's browser and starts streaming upon approval. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `props?` | \{ `audioConstraints?`: `boolean` \| `MediaTrackConstraints`; `videoConstraints?`: `boolean` \| `MediaTrackConstraints`; \} | +| `props.audioConstraints?` | `boolean` \| `MediaTrackConstraints` | +| `props.videoConstraints?` | `boolean` \| `MediaTrackConstraints` | + +#### Returns + +`Promise`\<`void`\> + +### stopStreaming() + +> **stopStreaming**: () => `Promise`\<`void`\> = `screenShareManager.stopStreaming` + +Stops the stream and cancels browser screen sharing. + +#### Returns + +`Promise`\<`void`\> + +### stream + +> **stream**: `null` \| `MediaStream` = `screenShareManager.stream` + +The MediaStream object containing both tracks. + +### videoTrack + +> **videoTrack**: `null` \| `MediaStreamTrack` = `screenShareManager.videoTrack` + +The separate video MediaStreamTrack. diff --git a/versioned_docs/version-0.25.0/api/web/functions/useUpdatePeerMetadata.md b/versioned_docs/version-0.25.0/api/web/functions/useUpdatePeerMetadata.md new file mode 100644 index 00000000..c1bf63dc --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useUpdatePeerMetadata.md @@ -0,0 +1,31 @@ +# Function: useUpdatePeerMetadata() + +> **useUpdatePeerMetadata**\<`PeerMetadata`\>(): `object` + +Defined in: [react-client/src/hooks/useUpdatePeerMetadata.ts:12](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useUpdatePeerMetadata.ts#L12) + +Hook provides a method to update the metadata of the local peer. + +## Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `PeerMetadata` *extends* `GenericMetadata` | `GenericMetadata` | + +## Returns + +### updatePeerMetadata() + +> **updatePeerMetadata**: (`peerMetadata`) => `void` + +Updates metadata visible to other peers + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `peerMetadata` | `PeerMetadata` | + +#### Returns + +`void` diff --git a/versioned_docs/version-0.25.0/api/web/functions/useVAD.md b/versioned_docs/version-0.25.0/api/web/functions/useVAD.md new file mode 100644 index 00000000..0a95ccd9 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/functions/useVAD.md @@ -0,0 +1,20 @@ +# Function: useVAD() + +> **useVAD**(`options`): `Record`\<[`PeerId`](../type-aliases/PeerId.md), `boolean`\> + +Defined in: [react-client/src/hooks/useVAD.ts:26](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useVAD.ts#L26) + +Voice activity detection. Use this hook to check if voice is detected in audio track for given peer(s). + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `options` | \{ `peerIds`: readonly [`PeerId`](../type-aliases/PeerId.md)[]; \} | Options object containing `peerIds` - a list of ids of peers to subscribe to for voice activity detection notifications. Example usage: `import { useVAD, type PeerId } from "@fishjam-cloud/react-client"; function WhoIsTalkingComponent({ peerIds }: { peerIds: PeerId[] }) { const peersInfo = useVAD({peerIds}); const activePeers = (Object.keys(peersInfo) as PeerId[]).filter((peerId) => peersInfo[peerId]); return "Now talking: " + activePeers.join(", "); }` | +| `options.peerIds` | readonly [`PeerId`](../type-aliases/PeerId.md)[] | - | + +## Returns + +`Record`\<[`PeerId`](../type-aliases/PeerId.md), `boolean`\> + +Each key is a peerId and the boolean value indicates if voice activity is currently detected for that peer. diff --git a/versioned_docs/version-0.25.0/api/web/index.md b/versioned_docs/version-0.25.0/api/web/index.md new file mode 100644 index 00000000..6b0b977b --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/index.md @@ -0,0 +1,73 @@ +# @fishjam-cloud/react-client + +## Connection + +- [useConnection](functions/useConnection.md) +- [useDataChannel](functions/useDataChannel.md) +- [usePeers](functions/usePeers.md) +- [useUpdatePeerMetadata](functions/useUpdatePeerMetadata.md) +- [useVAD](functions/useVAD.md) +- [Metadata](type-aliases/Metadata.md) + +## Devices + +- [useCamera](functions/useCamera.md) +- [useInitializeDevices](functions/useInitializeDevices.md) +- [useMicrophone](functions/useMicrophone.md) +- [useScreenShare](functions/useScreenShare.md) + +## Components + +- [FishjamProvider](functions/FishjamProvider.md) +- [FishjamProviderProps](interfaces/FishjamProviderProps.md) + +## Livestream + +- [useLivestreamStreamer](functions/useLivestreamStreamer.md) +- [useLivestreamViewer](functions/useLivestreamViewer.md) +- [UseLivestreamStreamerResult](interfaces/UseLivestreamStreamerResult.md) +- [UseLivestreamViewerResult](interfaces/UseLivestreamViewerResult.md) +- [ConnectStreamerConfig](type-aliases/ConnectStreamerConfig.md) +- [StreamerInputs](type-aliases/StreamerInputs.md) + +## Other + +- [useCustomSource](functions/useCustomSource.md) +- [useSandbox](functions/useSandbox.md) +- [Variant](enumerations/Variant.md) +- [DataChannelOptions](interfaces/DataChannelOptions.md) +- [JoinRoomConfig](interfaces/JoinRoomConfig.md) +- [SimulcastConfig](interfaces/SimulcastConfig.md) +- [AuthErrorReason](type-aliases/AuthErrorReason.md) +- [BandwidthLimits](type-aliases/BandwidthLimits.md) +- [Brand](type-aliases/Brand.md) +- [ConnectViewerConfig](type-aliases/ConnectViewerConfig.md) +- [CustomSource](type-aliases/CustomSource.md) +- [DataCallback](type-aliases/DataCallback.md) +- [DeviceError](type-aliases/DeviceError.md) +- [DeviceItem](type-aliases/DeviceItem.md) +- [InitializeDevicesResult](type-aliases/InitializeDevicesResult.md) +- [InitializeDevicesSettings](type-aliases/InitializeDevicesSettings.md) +- [InitializeDevicesStatus](type-aliases/InitializeDevicesStatus.md) +- [JoinErrorReason](type-aliases/JoinErrorReason.md) +- [MiddlewareResult](type-aliases/MiddlewareResult.md) +- [PeerId](type-aliases/PeerId.md) +- [PeerStatus](type-aliases/PeerStatus.md) +- [PeerWithTracks](type-aliases/PeerWithTracks.md) +- [PersistLastDeviceHandlers](type-aliases/PersistLastDeviceHandlers.md) +- [ReconnectConfig](type-aliases/ReconnectConfig.md) +- [ReconnectionStatus](type-aliases/ReconnectionStatus.md) +- [RoomType](type-aliases/RoomType.md) +- [SimulcastBandwidthLimit](type-aliases/SimulcastBandwidthLimit.md) +- [SimulcastBandwidthLimits](type-aliases/SimulcastBandwidthLimits.md) +- [StreamConfig](type-aliases/StreamConfig.md) +- [Track](type-aliases/Track.md) +- [TrackBandwidthLimit](type-aliases/TrackBandwidthLimit.md) +- [TrackId](type-aliases/TrackId.md) +- [TrackMiddleware](type-aliases/TrackMiddleware.md) +- [TracksMiddleware](type-aliases/TracksMiddleware.md) +- [TracksMiddlewareResult](type-aliases/TracksMiddlewareResult.md) +- [UseDataChannelResult](type-aliases/UseDataChannelResult.md) +- [UseInitializeDevicesParams](type-aliases/UseInitializeDevicesParams.md) +- [UseSandboxProps](type-aliases/UseSandboxProps.md) +- [SimulcastConfig](variables/SimulcastConfig.md) diff --git a/versioned_docs/version-0.25.0/api/web/interfaces/DataChannelOptions.md b/versioned_docs/version-0.25.0/api/web/interfaces/DataChannelOptions.md new file mode 100644 index 00000000..5ec23b50 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/interfaces/DataChannelOptions.md @@ -0,0 +1,16 @@ +# Interface: DataChannelOptions + +Defined in: ts-client/dist/index.d.mts:468 + +Options for publishing or subscribing to data. + +## Properties + +### reliable + +> **reliable**: `boolean` + +Defined in: ts-client/dist/index.d.mts:473 + +If true, uses the reliable data channel (ordered, guaranteed delivery). +If false, uses the lossy data channel (unordered, low latency). diff --git a/versioned_docs/version-0.25.0/api/web/interfaces/FishjamProviderProps.md b/versioned_docs/version-0.25.0/api/web/interfaces/FishjamProviderProps.md new file mode 100644 index 00000000..1f65cd08 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/interfaces/FishjamProviderProps.md @@ -0,0 +1,107 @@ +# Interface: FishjamProviderProps + +Defined in: [react-client/src/FishjamProvider.tsx:27](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L27) + +## Extends + +- `PropsWithChildren` + +## Properties + +### audioConfig? + +> `optional` **audioConfig**: [`StreamConfig`](../type-aliases/StreamConfig.md) + +Defined in: [react-client/src/FishjamProvider.tsx:55](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L55) + +Configure whether to use audio simulcast and which layers to send if so. + +*** + +### bandwidthLimits? + +> `optional` **bandwidthLimits**: `Partial`\<[`BandwidthLimits`](../type-aliases/BandwidthLimits.md)\> + +Defined in: [react-client/src/FishjamProvider.tsx:47](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L47) + +Adjust max bandwidth limit for a single stream and simulcast. + +*** + +### constraints? + +> `optional` **constraints**: `Pick`\<`MediaStreamConstraints`, `"audio"` \| `"video"`\> + +Defined in: [react-client/src/FishjamProvider.tsx:38](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L38) + +Set preferred constraints. + +#### Param + +The media stream constraints as defined by the Web API. + +#### See + +[MediaStreamConstraints](https://udn.realityripple.com/docs/Web/API/MediaStreamConstraints) + +*** + +### debug? + +> `optional` **debug**: `boolean` + +Defined in: [react-client/src/FishjamProvider.tsx:63](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L63) + +Enables Fishjam SDK's debug logs in the console. + +*** + +### fishjamClient? + +> `optional` **fishjamClient**: `FishjamClient`\<`GenericMetadata`, `GenericMetadata`\> + +Defined in: [react-client/src/FishjamProvider.tsx:67](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L67) + +Allows to provide your own FishjamClient instance from ts-client. + +*** + +### fishjamId + +> **fishjamId**: `string` + +Defined in: [react-client/src/FishjamProvider.tsx:59](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L59) + +You can get you Fishjam ID at https://fishjam.io/app + +*** + +### persistLastDevice? + +> `optional` **persistLastDevice**: `boolean` \| [`PersistLastDeviceHandlers`](../type-aliases/PersistLastDeviceHandlers.md) + +Defined in: [react-client/src/FishjamProvider.tsx:43](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L43) + +Decide if you want Fishjam SDK to persist last used device in the local storage. +You can also provide your getter and setter by using the [PersistLastDeviceHandlers](../type-aliases/PersistLastDeviceHandlers.md) interface. + +*** + +### reconnect? + +> `optional` **reconnect**: `boolean` \| [`ReconnectConfig`](../type-aliases/ReconnectConfig.md) + +Defined in: [react-client/src/FishjamProvider.tsx:32](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L32) + +Use [ReconnectConfig](../type-aliases/ReconnectConfig.md) to adjust reconnection policy to your needs or set false it. +Set to true by default. + +*** + +### videoConfig? + +> `optional` **videoConfig**: [`StreamConfig`](../type-aliases/StreamConfig.md) + +Defined in: [react-client/src/FishjamProvider.tsx:51](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/FishjamProvider.tsx#L51) + +Configure whether to use video simulcast and which layers to send if so. diff --git a/versioned_docs/version-0.25.0/api/web/interfaces/JoinRoomConfig.md b/versioned_docs/version-0.25.0/api/web/interfaces/JoinRoomConfig.md new file mode 100644 index 00000000..139694e7 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/interfaces/JoinRoomConfig.md @@ -0,0 +1,29 @@ +# Interface: JoinRoomConfig\ + +Defined in: [react-client/src/hooks/useConnection.ts:10](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useConnection.ts#L10) + +## Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `PeerMetadata` *extends* `GenericMetadata` | `GenericMetadata` | + +## Properties + +### peerMetadata? + +> `optional` **peerMetadata**: `PeerMetadata` + +Defined in: [react-client/src/hooks/useConnection.ts:18](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useConnection.ts#L18) + +String indexed record with metadata, that will be available to all other peers + +*** + +### peerToken + +> **peerToken**: `string` + +Defined in: [react-client/src/hooks/useConnection.ts:14](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useConnection.ts#L14) + +Token received from server (or Room Manager) diff --git a/versioned_docs/version-0.25.0/api/web/interfaces/SimulcastConfig.md b/versioned_docs/version-0.25.0/api/web/interfaces/SimulcastConfig.md new file mode 100644 index 00000000..7bfb9dd5 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/interfaces/SimulcastConfig.md @@ -0,0 +1,27 @@ +# Interface: SimulcastConfig + +Defined in: ts-client/dist/index.d.mts:164 + +## Properties + +### disabledVariants + +> **disabledVariants**: [`Variant`](../enumerations/Variant.md)[] + +Defined in: ts-client/dist/index.d.mts:167 + +*** + +### enabled + +> **enabled**: `boolean` + +Defined in: ts-client/dist/index.d.mts:165 + +*** + +### enabledVariants + +> **enabledVariants**: [`Variant`](../enumerations/Variant.md)[] + +Defined in: ts-client/dist/index.d.mts:166 diff --git a/versioned_docs/version-0.25.0/api/web/interfaces/UseLivestreamStreamerResult.md b/versioned_docs/version-0.25.0/api/web/interfaces/UseLivestreamStreamerResult.md new file mode 100644 index 00000000..6fc704df --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/interfaces/UseLivestreamStreamerResult.md @@ -0,0 +1,62 @@ +# Interface: UseLivestreamStreamerResult + +Defined in: [react-client/src/hooks/useLivestreamStreamer.ts:28](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamStreamer.ts#L28) + +## Properties + +### connect() + +> **connect**: (`inputs`, `urlOverride?`) => `Promise`\<`void`\> + +Defined in: [react-client/src/hooks/useLivestreamStreamer.ts:35](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamStreamer.ts#L35) + +Callback used to start publishing the selected audio and video media streams. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `inputs` | [`ConnectStreamerConfig`](../type-aliases/ConnectStreamerConfig.md) | +| `urlOverride?` | `string` | + +#### Returns + +`Promise`\<`void`\> + +#### Remarks + +Calling [connect](#connect) multiple times will have the effect of only publishing the **last** specified inputs. + +*** + +### disconnect() + +> **disconnect**: () => `void` + +Defined in: [react-client/src/hooks/useLivestreamStreamer.ts:37](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamStreamer.ts#L37) + +Callback to stop publishing anything previously published with [connect](#connect) + +#### Returns + +`void` + +*** + +### error + +> **error**: `null` \| `LivestreamError` + +Defined in: [react-client/src/hooks/useLivestreamStreamer.ts:39](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamStreamer.ts#L39) + +Any errors encountered in [connect](#connect) will populate this field + +*** + +### isConnected + +> **isConnected**: `boolean` + +Defined in: [react-client/src/hooks/useLivestreamStreamer.ts:41](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamStreamer.ts#L41) + +Utility flag which indicates the current connection status diff --git a/versioned_docs/version-0.25.0/api/web/interfaces/UseLivestreamViewerResult.md b/versioned_docs/version-0.25.0/api/web/interfaces/UseLivestreamViewerResult.md new file mode 100644 index 00000000..4cbe4914 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/interfaces/UseLivestreamViewerResult.md @@ -0,0 +1,70 @@ +# Interface: UseLivestreamViewerResult + +Defined in: [react-client/src/hooks/useLivestreamViewer.ts:12](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamViewer.ts#L12) + +## Properties + +### connect() + +> **connect**: (`config`, `url?`) => `Promise`\<`void`\> + +Defined in: [react-client/src/hooks/useLivestreamViewer.ts:20](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamViewer.ts#L20) + +Callback to start receiving a livestream. +If the livestream is private, provide `token`. +If the livestream is public, provide `streamId`. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`ConnectViewerConfig`](../type-aliases/ConnectViewerConfig.md) | +| `url?` | `string` | + +#### Returns + +`Promise`\<`void`\> + +*** + +### disconnect() + +> **disconnect**: () => `void` + +Defined in: [react-client/src/hooks/useLivestreamViewer.ts:22](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamViewer.ts#L22) + +Callback used to disconnect from a stream previously connected to with [connect](#connect) + +#### Returns + +`void` + +*** + +### error + +> **error**: `null` \| `LivestreamError` + +Defined in: [react-client/src/hooks/useLivestreamViewer.ts:24](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamViewer.ts#L24) + +Any errors encountered in [connect](#connect) will be present in this field. + +*** + +### isConnected + +> **isConnected**: `boolean` + +Defined in: [react-client/src/hooks/useLivestreamViewer.ts:26](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamViewer.ts#L26) + +Utility flag which indicates the current connection status + +*** + +### stream + +> **stream**: `null` \| `MediaStream` + +Defined in: [react-client/src/hooks/useLivestreamViewer.ts:14](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamViewer.ts#L14) + +The received livestream media diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/AuthErrorReason.md b/versioned_docs/version-0.25.0/api/web/type-aliases/AuthErrorReason.md new file mode 100644 index 00000000..5ce791b0 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/AuthErrorReason.md @@ -0,0 +1,5 @@ +# Type Alias: AuthErrorReason + +> **AuthErrorReason** = *typeof* `AUTH_ERROR_REASONS`\[`number`\] + +Defined in: ts-client/dist/index.d.mts:5 diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/BandwidthLimits.md b/versioned_docs/version-0.25.0/api/web/type-aliases/BandwidthLimits.md new file mode 100644 index 00000000..37454f63 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/BandwidthLimits.md @@ -0,0 +1,21 @@ +# Type Alias: BandwidthLimits + +> **BandwidthLimits** = `object` + +Defined in: [react-client/src/types/public.ts:67](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L67) + +## Properties + +### simulcast + +> **simulcast**: [`SimulcastBandwidthLimits`](SimulcastBandwidthLimits.md) + +Defined in: [react-client/src/types/public.ts:67](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L67) + +*** + +### singleStream + +> **singleStream**: `number` + +Defined in: [react-client/src/types/public.ts:67](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L67) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/Brand.md b/versioned_docs/version-0.25.0/api/web/type-aliases/Brand.md new file mode 100644 index 00000000..6391702b --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/Brand.md @@ -0,0 +1,18 @@ +# Type Alias: Brand\ + +> **Brand**\<`T`, `TBrand`\> = `T` & `object` + +Defined in: [react-client/src/types/public.ts:78](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L78) + +## Type declaration + +### \[brand\] + +> **\[brand\]**: `TBrand` + +## Type Parameters + +| Type Parameter | +| ------ | +| `T` | +| `TBrand` *extends* `string` | diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/ConnectStreamerConfig.md b/versioned_docs/version-0.25.0/api/web/type-aliases/ConnectStreamerConfig.md new file mode 100644 index 00000000..4393542b --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/ConnectStreamerConfig.md @@ -0,0 +1,23 @@ +# Type Alias: ConnectStreamerConfig + +> **ConnectStreamerConfig** = `object` + +Defined in: [react-client/src/hooks/useLivestreamStreamer.ts:21](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamStreamer.ts#L21) + +## Properties + +### inputs + +> **inputs**: [`StreamerInputs`](StreamerInputs.md) + +Defined in: [react-client/src/hooks/useLivestreamStreamer.ts:22](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamStreamer.ts#L22) + +*** + +### token + +> **token**: `string` + +Defined in: [react-client/src/hooks/useLivestreamStreamer.ts:24](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamStreamer.ts#L24) + +Streamer token used to authenticate with Fishjam diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/ConnectViewerConfig.md b/versioned_docs/version-0.25.0/api/web/type-aliases/ConnectViewerConfig.md new file mode 100644 index 00000000..e497cb97 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/ConnectViewerConfig.md @@ -0,0 +1,5 @@ +# Type Alias: ConnectViewerConfig + +> **ConnectViewerConfig** = \{ `streamId?`: `never`; `token`: `string`; \} \| \{ `streamId`: `string`; `token?`: `never`; \} + +Defined in: [react-client/src/hooks/useLivestreamViewer.ts:7](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamViewer.ts#L7) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/CustomSource.md b/versioned_docs/version-0.25.0/api/web/type-aliases/CustomSource.md new file mode 100644 index 00000000..e0c37eea --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/CustomSource.md @@ -0,0 +1,40 @@ +# Type Alias: CustomSource\ + +> **CustomSource**\<`T`\> = `object` + +Defined in: [react-client/src/types/public.ts:80](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L80) + +## Type Parameters + +| Type Parameter | +| ------ | +| `T` *extends* `string` | + +## Properties + +### id + +> **id**: `T` + +Defined in: [react-client/src/types/public.ts:81](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L81) + +*** + +### stream? + +> `optional` **stream**: `MediaStream` + +Defined in: [react-client/src/types/public.ts:83](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L83) + +*** + +### trackIds? + +> `optional` **trackIds**: `object` + +Defined in: [react-client/src/types/public.ts:82](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L82) + +| Name | Type | +| ------ | ------ | +| `audioId?` | `string` | +| `videoId?` | `string` | diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/DataCallback.md b/versioned_docs/version-0.25.0/api/web/type-aliases/DataCallback.md new file mode 100644 index 00000000..3b89214c --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/DataCallback.md @@ -0,0 +1,17 @@ +# Type Alias: DataCallback() + +> **DataCallback** = (`data`) => `void` + +Defined in: ts-client/dist/index.d.mts:479 + +Callback type for receiving data from a data channel. + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `data` | `Uint8Array` | The received data as a Uint8Array | + +## Returns + +`void` diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/DeviceError.md b/versioned_docs/version-0.25.0/api/web/type-aliases/DeviceError.md new file mode 100644 index 00000000..24608605 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/DeviceError.md @@ -0,0 +1,5 @@ +# Type Alias: DeviceError + +> **DeviceError** = \{ `name`: `"OverconstrainedError"`; \} \| \{ `name`: `"NotAllowedError"`; \} \| \{ `name`: `"NotFoundError"`; \} \| \{ `name`: `"UNHANDLED_ERROR"`; \} + +Defined in: [react-client/src/types/public.ts:71](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L71) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/DeviceItem.md b/versioned_docs/version-0.25.0/api/web/type-aliases/DeviceItem.md new file mode 100644 index 00000000..bd0ea00f --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/DeviceItem.md @@ -0,0 +1,21 @@ +# Type Alias: DeviceItem + +> **DeviceItem** = `object` + +Defined in: [react-client/src/types/public.ts:52](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L52) + +## Properties + +### deviceId + +> **deviceId**: `string` + +Defined in: [react-client/src/types/public.ts:52](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L52) + +*** + +### label + +> **label**: `string` + +Defined in: [react-client/src/types/public.ts:52](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L52) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/InitializeDevicesResult.md b/versioned_docs/version-0.25.0/api/web/type-aliases/InitializeDevicesResult.md new file mode 100644 index 00000000..f646ac78 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/InitializeDevicesResult.md @@ -0,0 +1,29 @@ +# Type Alias: InitializeDevicesResult + +> **InitializeDevicesResult** = `object` + +Defined in: [react-client/src/types/public.ts:11](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L11) + +## Properties + +### errors + +> **errors**: \{ `audio`: [`DeviceError`](DeviceError.md) \| `null`; `video`: [`DeviceError`](DeviceError.md) \| `null`; \} \| `null` + +Defined in: [react-client/src/types/public.ts:14](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L14) + +*** + +### status + +> **status**: [`InitializeDevicesStatus`](InitializeDevicesStatus.md) + +Defined in: [react-client/src/types/public.ts:12](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L12) + +*** + +### stream + +> **stream**: `MediaStream` \| `null` + +Defined in: [react-client/src/types/public.ts:13](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L13) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/InitializeDevicesSettings.md b/versioned_docs/version-0.25.0/api/web/type-aliases/InitializeDevicesSettings.md new file mode 100644 index 00000000..407cf0be --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/InitializeDevicesSettings.md @@ -0,0 +1,21 @@ +# Type Alias: InitializeDevicesSettings + +> **InitializeDevicesSettings** = `object` + +Defined in: [react-client/src/hooks/internal/devices/useMediaDevices.ts:16](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/internal/devices/useMediaDevices.ts#L16) + +## Properties + +### enableAudio? + +> `optional` **enableAudio**: `boolean` + +Defined in: [react-client/src/hooks/internal/devices/useMediaDevices.ts:16](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/internal/devices/useMediaDevices.ts#L16) + +*** + +### enableVideo? + +> `optional` **enableVideo**: `boolean` + +Defined in: [react-client/src/hooks/internal/devices/useMediaDevices.ts:16](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/internal/devices/useMediaDevices.ts#L16) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/InitializeDevicesStatus.md b/versioned_docs/version-0.25.0/api/web/type-aliases/InitializeDevicesStatus.md new file mode 100644 index 00000000..f61d44bd --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/InitializeDevicesStatus.md @@ -0,0 +1,5 @@ +# Type Alias: InitializeDevicesStatus + +> **InitializeDevicesStatus** = `"initialized"` \| `"failed"` \| `"initialized_with_errors"` \| `"already_initialized"` + +Defined in: [react-client/src/types/public.ts:9](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L9) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/JoinErrorReason.md b/versioned_docs/version-0.25.0/api/web/type-aliases/JoinErrorReason.md new file mode 100644 index 00000000..84664529 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/JoinErrorReason.md @@ -0,0 +1,5 @@ +# Type Alias: JoinErrorReason + +> **JoinErrorReason** = *typeof* `JOIN_ERRORS`\[`number`\] + +Defined in: ts-client/dist/index.d.mts:888 diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/Metadata.md b/versioned_docs/version-0.25.0/api/web/type-aliases/Metadata.md new file mode 100644 index 00000000..9f151db7 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/Metadata.md @@ -0,0 +1,28 @@ +# Type Alias: Metadata\ + +> **Metadata**\<`PeerMetadata`, `ServerMetadata`\> = `object` + +Defined in: ts-client/dist/index.d.mts:911 + +## Type Parameters + +| Type Parameter | Default type | Description | +| ------ | ------ | ------ | +| `PeerMetadata` | `GenericMetadata` | Type of metadata set by peer while connecting to a room. | +| `ServerMetadata` | `GenericMetadata` | Type of metadata set by the server while creating a peer. | + +## Properties + +### peer + +> **peer**: `PeerMetadata` + +Defined in: ts-client/dist/index.d.mts:912 + +*** + +### server + +> **server**: `ServerMetadata` + +Defined in: ts-client/dist/index.d.mts:913 diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/MiddlewareResult.md b/versioned_docs/version-0.25.0/api/web/type-aliases/MiddlewareResult.md new file mode 100644 index 00000000..a535c20d --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/MiddlewareResult.md @@ -0,0 +1,25 @@ +# Type Alias: MiddlewareResult + +> **MiddlewareResult** = `object` + +Defined in: [react-client/src/types/public.ts:29](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L29) + +## Properties + +### onClear()? + +> `optional` **onClear**: () => `void` + +Defined in: [react-client/src/types/public.ts:29](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L29) + +#### Returns + +`void` + +*** + +### track + +> **track**: `MediaStreamTrack` + +Defined in: [react-client/src/types/public.ts:29](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L29) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/PeerId.md b/versioned_docs/version-0.25.0/api/web/type-aliases/PeerId.md new file mode 100644 index 00000000..c2c6908b --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/PeerId.md @@ -0,0 +1,5 @@ +# Type Alias: PeerId + +> **PeerId** = [`Brand`](Brand.md)\<`string`, `"PeerId"`\> + +Defined in: [react-client/src/types/public.ts:18](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L18) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/PeerStatus.md b/versioned_docs/version-0.25.0/api/web/type-aliases/PeerStatus.md new file mode 100644 index 00000000..5d6d8ed3 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/PeerStatus.md @@ -0,0 +1,12 @@ +# Type Alias: PeerStatus + +> **PeerStatus** = `"connecting"` \| `"connected"` \| `"error"` \| `"idle"` + +Defined in: [react-client/src/types/public.ts:50](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L50) + +Represents the possible statuses of a peer connection. + +- `idle` - Peer is not connected, either never connected or successfully disconnected. +- `connecting` - Peer is in the process of connecting. +- `connected` - Peer has successfully connected. +- `error` - There was an error in the connection process. diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/PeerWithTracks.md b/versioned_docs/version-0.25.0/api/web/type-aliases/PeerWithTracks.md new file mode 100644 index 00000000..60ef5b04 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/PeerWithTracks.md @@ -0,0 +1,84 @@ +# Type Alias: PeerWithTracks\ + +> **PeerWithTracks**\<`PeerMetadata`, `ServerMetadata`\> = `object` + +Defined in: [react-client/src/hooks/usePeers.ts:13](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L13) + +## Type Parameters + +| Type Parameter | Description | +| ------ | ------ | +| `PeerMetadata` | Type of metadata set by peer while connecting to a room. | +| `ServerMetadata` | Type of metadata set by the server while creating a peer. | + +## Properties + +### cameraTrack? + +> `optional` **cameraTrack**: [`Track`](Track.md) + +Defined in: [react-client/src/hooks/usePeers.ts:17](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L17) + +*** + +### customAudioTracks + +> **customAudioTracks**: [`Track`](Track.md)[] + +Defined in: [react-client/src/hooks/usePeers.ts:22](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L22) + +*** + +### customVideoTracks + +> **customVideoTracks**: [`Track`](Track.md)[] + +Defined in: [react-client/src/hooks/usePeers.ts:21](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L21) + +*** + +### id + +> **id**: [`PeerId`](PeerId.md) + +Defined in: [react-client/src/hooks/usePeers.ts:14](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L14) + +*** + +### metadata? + +> `optional` **metadata**: [`Metadata`](Metadata.md)\<`PeerMetadata`, `ServerMetadata`\> + +Defined in: [react-client/src/hooks/usePeers.ts:15](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L15) + +*** + +### microphoneTrack? + +> `optional` **microphoneTrack**: [`Track`](Track.md) + +Defined in: [react-client/src/hooks/usePeers.ts:18](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L18) + +*** + +### screenShareAudioTrack? + +> `optional` **screenShareAudioTrack**: [`Track`](Track.md) + +Defined in: [react-client/src/hooks/usePeers.ts:20](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L20) + +*** + +### screenShareVideoTrack? + +> `optional` **screenShareVideoTrack**: [`Track`](Track.md) + +Defined in: [react-client/src/hooks/usePeers.ts:19](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L19) + +*** + +### tracks + +> **tracks**: [`Track`](Track.md)[] + +Defined in: [react-client/src/hooks/usePeers.ts:16](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/usePeers.ts#L16) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/PersistLastDeviceHandlers.md b/versioned_docs/version-0.25.0/api/web/type-aliases/PersistLastDeviceHandlers.md new file mode 100644 index 00000000..dc03ff16 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/PersistLastDeviceHandlers.md @@ -0,0 +1,42 @@ +# Type Alias: PersistLastDeviceHandlers + +> **PersistLastDeviceHandlers** = `object` + +Defined in: [react-client/src/types/public.ts:54](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L54) + +## Properties + +### getLastDevice() + +> **getLastDevice**: (`deviceType`) => `MediaDeviceInfo` \| `null` + +Defined in: [react-client/src/types/public.ts:55](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L55) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `deviceType` | `"audio"` \| `"video"` | + +#### Returns + +`MediaDeviceInfo` \| `null` + +*** + +### saveLastDevice() + +> **saveLastDevice**: (`info`, `deviceType`) => `void` + +Defined in: [react-client/src/types/public.ts:56](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L56) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `info` | `MediaDeviceInfo` | +| `deviceType` | `"audio"` \| `"video"` | + +#### Returns + +`void` diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/ReconnectConfig.md b/versioned_docs/version-0.25.0/api/web/type-aliases/ReconnectConfig.md new file mode 100644 index 00000000..8025660b --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/ReconnectConfig.md @@ -0,0 +1,37 @@ +# Type Alias: ReconnectConfig + +> **ReconnectConfig** = `object` + +Defined in: ts-client/dist/index.d.mts:892 + +## Properties + +### addTracksOnReconnect? + +> `optional` **addTracksOnReconnect**: `boolean` + +Defined in: ts-client/dist/index.d.mts:896 + +*** + +### delay? + +> `optional` **delay**: `number` + +Defined in: ts-client/dist/index.d.mts:895 + +*** + +### initialDelay? + +> `optional` **initialDelay**: `number` + +Defined in: ts-client/dist/index.d.mts:894 + +*** + +### maxAttempts? + +> `optional` **maxAttempts**: `number` + +Defined in: ts-client/dist/index.d.mts:893 diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/ReconnectionStatus.md b/versioned_docs/version-0.25.0/api/web/type-aliases/ReconnectionStatus.md new file mode 100644 index 00000000..797c9e06 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/ReconnectionStatus.md @@ -0,0 +1,5 @@ +# Type Alias: ReconnectionStatus + +> **ReconnectionStatus** = `"reconnecting"` \| `"idle"` \| `"error"` + +Defined in: ts-client/dist/index.d.mts:891 diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/RoomType.md b/versioned_docs/version-0.25.0/api/web/type-aliases/RoomType.md new file mode 100644 index 00000000..e5e60224 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/RoomType.md @@ -0,0 +1,5 @@ +# Type Alias: RoomType + +> **RoomType** = `"conference"` \| `"livestream"` \| `"audio_only"` + +Defined in: [react-client/src/hooks/useSandbox.ts:17](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useSandbox.ts#L17) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/SimulcastBandwidthLimit.md b/versioned_docs/version-0.25.0/api/web/type-aliases/SimulcastBandwidthLimit.md new file mode 100644 index 00000000..19b5d2d1 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/SimulcastBandwidthLimit.md @@ -0,0 +1,9 @@ +# Type Alias: SimulcastBandwidthLimit + +> **SimulcastBandwidthLimit** = `Map`\<[`Variant`](../enumerations/Variant.md), `BandwidthLimit`\> + +Defined in: ts-client/dist/index.d.mts:219 + +Type describing bandwidth limit for simulcast track. +It is a mapping (encoding => BandwidthLimit). +If encoding isn't present in this mapping, it will be assumed that this particular encoding shouldn't have any bandwidth limit diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/SimulcastBandwidthLimits.md b/versioned_docs/version-0.25.0/api/web/type-aliases/SimulcastBandwidthLimits.md new file mode 100644 index 00000000..607423f4 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/SimulcastBandwidthLimits.md @@ -0,0 +1,29 @@ +# Type Alias: SimulcastBandwidthLimits + +> **SimulcastBandwidthLimits** = `object` + +Defined in: [react-client/src/types/public.ts:59](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L59) + +## Properties + +### 1 + +> **1**: `number` + +Defined in: [react-client/src/types/public.ts:60](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L60) + +*** + +### 2 + +> **2**: `number` + +Defined in: [react-client/src/types/public.ts:61](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L61) + +*** + +### 3 + +> **3**: `number` + +Defined in: [react-client/src/types/public.ts:62](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L62) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/StreamConfig.md b/versioned_docs/version-0.25.0/api/web/type-aliases/StreamConfig.md new file mode 100644 index 00000000..238a3189 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/StreamConfig.md @@ -0,0 +1,13 @@ +# Type Alias: StreamConfig + +> **StreamConfig** = `object` + +Defined in: [react-client/src/types/public.ts:65](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L65) + +## Properties + +### simulcast? + +> `optional` **simulcast**: [`Variant`](../enumerations/Variant.md)[] \| `false` + +Defined in: [react-client/src/types/public.ts:65](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L65) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/StreamerInputs.md b/versioned_docs/version-0.25.0/api/web/type-aliases/StreamerInputs.md new file mode 100644 index 00000000..cbb9a869 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/StreamerInputs.md @@ -0,0 +1,31 @@ +# Type Alias: StreamerInputs + +> **StreamerInputs** = \{ `audio?`: `MediaStream` \| `null`; `video`: `MediaStream`; \} \| \{ `audio`: `MediaStream`; `video?`: `null`; \} + +Defined in: [react-client/src/hooks/useLivestreamStreamer.ts:8](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useLivestreamStreamer.ts#L8) + +## Type declaration + +\{ `audio?`: `MediaStream` \| `null`; `video`: `MediaStream`; \} + +### audio? + +> `optional` **audio**: `MediaStream` \| `null` + +The audio source to publish. e.g. `microphoneStream` from [useMicrophone](../functions/useMicrophone.md) or `stream` from [useScreenShare](../functions/useScreenShare.md) + +### video + +> **video**: `MediaStream` + +The video source to publish. e.g. `cameraStream` from [useCamera](../functions/useCamera.md) or `stream` from [useScreenShare](../functions/useScreenShare.md) + +\{ `audio`: `MediaStream`; `video?`: `null`; \} + +### audio + +> **audio**: `MediaStream` + +### video? + +> `optional` **video**: `null` diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/Track.md b/versioned_docs/version-0.25.0/api/web/type-aliases/Track.md new file mode 100644 index 00000000..db8f77bb --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/Track.md @@ -0,0 +1,53 @@ +# Type Alias: Track + +> **Track** = `object` + +Defined in: [react-client/src/types/public.ts:20](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L20) + +## Properties + +### encoding + +> **encoding**: [`Variant`](../enumerations/Variant.md) \| `null` + +Defined in: [react-client/src/types/public.ts:22](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L22) + +*** + +### metadata? + +> `optional` **metadata**: `TrackMetadata` + +Defined in: [react-client/src/types/public.ts:24](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L24) + +*** + +### simulcastConfig + +> **simulcastConfig**: [`SimulcastConfig`](../interfaces/SimulcastConfig.md) \| `null` + +Defined in: [react-client/src/types/public.ts:25](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L25) + +*** + +### stream + +> **stream**: `MediaStream` \| `null` + +Defined in: [react-client/src/types/public.ts:21](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L21) + +*** + +### track + +> **track**: `MediaStreamTrack` \| `null` + +Defined in: [react-client/src/types/public.ts:26](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L26) + +*** + +### trackId + +> **trackId**: [`TrackId`](TrackId.md) + +Defined in: [react-client/src/types/public.ts:23](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L23) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/TrackBandwidthLimit.md b/versioned_docs/version-0.25.0/api/web/type-aliases/TrackBandwidthLimit.md new file mode 100644 index 00000000..12ad867c --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/TrackBandwidthLimit.md @@ -0,0 +1,8 @@ +# Type Alias: TrackBandwidthLimit + +> **TrackBandwidthLimit** = `BandwidthLimit` \| [`SimulcastBandwidthLimit`](SimulcastBandwidthLimit.md) + +Defined in: ts-client/dist/index.d.mts:224 + +Type describing bandwidth limitation of a Track, including simulcast and non-simulcast tracks. +A sum type of `BandwidthLimit` and `SimulcastBandwidthLimit` diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/TrackId.md b/versioned_docs/version-0.25.0/api/web/type-aliases/TrackId.md new file mode 100644 index 00000000..3750d163 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/TrackId.md @@ -0,0 +1,5 @@ +# Type Alias: TrackId + +> **TrackId** = [`Brand`](Brand.md)\<`string`, `"TrackId"`\> + +Defined in: [react-client/src/types/public.ts:17](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L17) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/TrackMiddleware.md b/versioned_docs/version-0.25.0/api/web/type-aliases/TrackMiddleware.md new file mode 100644 index 00000000..d1c2dc3e --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/TrackMiddleware.md @@ -0,0 +1,5 @@ +# Type Alias: TrackMiddleware + +> **TrackMiddleware** = (`track`) => [`MiddlewareResult`](MiddlewareResult.md) \| `Promise`\<[`MiddlewareResult`](MiddlewareResult.md)\> \| `null` + +Defined in: [react-client/src/types/public.ts:30](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L30) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/TracksMiddleware.md b/versioned_docs/version-0.25.0/api/web/type-aliases/TracksMiddleware.md new file mode 100644 index 00000000..e1c5e7ee --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/TracksMiddleware.md @@ -0,0 +1,16 @@ +# Type Alias: TracksMiddleware() + +> **TracksMiddleware** = (`videoTrack`, `audioTrack`) => [`TracksMiddlewareResult`](TracksMiddlewareResult.md) \| `Promise`\<[`TracksMiddlewareResult`](TracksMiddlewareResult.md)\> + +Defined in: [react-client/src/types/public.ts:37](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L37) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `videoTrack` | `MediaStreamTrack` | +| `audioTrack` | `MediaStreamTrack` \| `null` | + +## Returns + +[`TracksMiddlewareResult`](TracksMiddlewareResult.md) \| `Promise`\<[`TracksMiddlewareResult`](TracksMiddlewareResult.md)\> diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/TracksMiddlewareResult.md b/versioned_docs/version-0.25.0/api/web/type-aliases/TracksMiddlewareResult.md new file mode 100644 index 00000000..69a62384 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/TracksMiddlewareResult.md @@ -0,0 +1,33 @@ +# Type Alias: TracksMiddlewareResult + +> **TracksMiddlewareResult** = `object` + +Defined in: [react-client/src/types/public.ts:32](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L32) + +## Properties + +### audioTrack + +> **audioTrack**: `MediaStreamTrack` \| `null` + +Defined in: [react-client/src/types/public.ts:34](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L34) + +*** + +### onClear() + +> **onClear**: () => `void` + +Defined in: [react-client/src/types/public.ts:35](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L35) + +#### Returns + +`void` + +*** + +### videoTrack + +> **videoTrack**: `MediaStreamTrack` + +Defined in: [react-client/src/types/public.ts:33](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L33) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/UseDataChannelResult.md b/versioned_docs/version-0.25.0/api/web/type-aliases/UseDataChannelResult.md new file mode 100644 index 00000000..06a06e53 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/UseDataChannelResult.md @@ -0,0 +1,101 @@ +# Type Alias: UseDataChannelResult + +> **UseDataChannelResult** = `object` + +Defined in: [react-client/src/types/public.ts:86](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L86) + +## Properties + +### dataChannelError + +> **dataChannelError**: `Error` \| `null` + +Defined in: [react-client/src/types/public.ts:119](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L119) + +Error that occurred during data publisher operations, or null if no error. + +*** + +### dataChannelLoading + +> **dataChannelLoading**: `boolean` + +Defined in: [react-client/src/types/public.ts:115](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L115) + +Whether data channels are being initialized. + +*** + +### dataChannelReady + +> **dataChannelReady**: `boolean` + +Defined in: [react-client/src/types/public.ts:111](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L111) + +Whether data channels are connected and ready to send data. +Resets to false on disconnect. + +*** + +### initializeDataChannel() + +> **initializeDataChannel**: () => `void` + +Defined in: [react-client/src/types/public.ts:92](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L92) + +Initializes the data channel. + +Requires that the fishjam client is already connected. + +#### Returns + +`void` + +*** + +### publishData() + +> **publishData**: (`payload`, `options`) => `void` + +Defined in: [react-client/src/types/public.ts:98](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L98) + +Sends binary data through a data channel. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `payload` | `Uint8Array` | The Uint8Array payload to send (first positional argument) | +| `options` | [`DataChannelOptions`](../interfaces/DataChannelOptions.md) | Data channel options; specify `reliable: true` for guaranteed delivery or `reliable: false` for low latency | + +#### Returns + +`void` + +*** + +### subscribeData() + +> **subscribeData**: (`callback`, `options`) => () => `void` + +Defined in: [react-client/src/types/public.ts:106](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/types/public.ts#L106) + +Subscribe to incoming data on a data channel. +Can be called before or after channel creation. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `callback` | [`DataCallback`](DataCallback.md) | Function called when data is received | +| `options` | [`DataChannelOptions`](../interfaces/DataChannelOptions.md) | Specify `reliable: true` or `reliable: false` to choose channel | + +#### Returns + +Unsubscribe function - call to cancel the subscription + +> (): `void` + +##### Returns + +`void` diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/UseInitializeDevicesParams.md b/versioned_docs/version-0.25.0/api/web/type-aliases/UseInitializeDevicesParams.md new file mode 100644 index 00000000..00dd88d1 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/UseInitializeDevicesParams.md @@ -0,0 +1,21 @@ +# Type Alias: UseInitializeDevicesParams + +> **UseInitializeDevicesParams** = `object` + +Defined in: [react-client/src/hooks/devices/useInitializeDevices.ts:5](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/devices/useInitializeDevices.ts#L5) + +## Properties + +### enableAudio? + +> `optional` **enableAudio**: `boolean` + +Defined in: [react-client/src/hooks/devices/useInitializeDevices.ts:7](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/devices/useInitializeDevices.ts#L7) + +*** + +### enableVideo? + +> `optional` **enableVideo**: `boolean` + +Defined in: [react-client/src/hooks/devices/useInitializeDevices.ts:6](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/devices/useInitializeDevices.ts#L6) diff --git a/versioned_docs/version-0.25.0/api/web/type-aliases/UseSandboxProps.md b/versioned_docs/version-0.25.0/api/web/type-aliases/UseSandboxProps.md new file mode 100644 index 00000000..780bbfc6 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/type-aliases/UseSandboxProps.md @@ -0,0 +1,17 @@ +# Type Alias: UseSandboxProps + +> **UseSandboxProps** = `object` + +Defined in: [react-client/src/hooks/useSandbox.ts:12](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useSandbox.ts#L12) + +## Properties + +### configOverride? + +> `optional` **configOverride**: `object` + +Defined in: [react-client/src/hooks/useSandbox.ts:14](https://github.com/fishjam-cloud/web-client-sdk/blob/d78484b4f189e2789ab2da373043d6e3c10800de/packages/react-client/src/hooks/useSandbox.ts#L14) + +| Name | Type | +| ------ | ------ | +| `sandboxApiUrl?` | `string` | diff --git a/versioned_docs/version-0.25.0/api/web/typedoc-sidebar.cjs b/versioned_docs/version-0.25.0/api/web/typedoc-sidebar.cjs new file mode 100644 index 00000000..f9abf685 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/typedoc-sidebar.cjs @@ -0,0 +1,4 @@ +// @ts-check +/** @type {import("@docusaurus/plugin-content-docs").SidebarsConfig} */ +const typedocSidebar = {items:[{type:"category",label:"Connection",items:[{type:"doc",id:"api/web/functions/useConnection",label:"useConnection"},{type:"doc",id:"api/web/functions/useDataChannel",label:"useDataChannel"},{type:"doc",id:"api/web/functions/usePeers",label:"usePeers"},{type:"doc",id:"api/web/functions/useUpdatePeerMetadata",label:"useUpdatePeerMetadata"},{type:"doc",id:"api/web/functions/useVAD",label:"useVAD"},{type:"doc",id:"api/web/type-aliases/Metadata",label:"Metadata"}]},{type:"category",label:"Devices",items:[{type:"doc",id:"api/web/functions/useCamera",label:"useCamera"},{type:"doc",id:"api/web/functions/useInitializeDevices",label:"useInitializeDevices"},{type:"doc",id:"api/web/functions/useMicrophone",label:"useMicrophone"},{type:"doc",id:"api/web/functions/useScreenShare",label:"useScreenShare"}]},{type:"category",label:"Components",items:[{type:"doc",id:"api/web/functions/FishjamProvider",label:"FishjamProvider"},{type:"doc",id:"api/web/interfaces/FishjamProviderProps",label:"FishjamProviderProps"}]},{type:"category",label:"Livestream",items:[{type:"doc",id:"api/web/functions/useLivestreamStreamer",label:"useLivestreamStreamer"},{type:"doc",id:"api/web/functions/useLivestreamViewer",label:"useLivestreamViewer"},{type:"doc",id:"api/web/interfaces/UseLivestreamStreamerResult",label:"UseLivestreamStreamerResult"},{type:"doc",id:"api/web/interfaces/UseLivestreamViewerResult",label:"UseLivestreamViewerResult"},{type:"doc",id:"api/web/type-aliases/ConnectStreamerConfig",label:"ConnectStreamerConfig"},{type:"doc",id:"api/web/type-aliases/StreamerInputs",label:"StreamerInputs"}]},{type:"category",label:"Other",items:[{type:"doc",id:"api/web/functions/useCustomSource",label:"useCustomSource"},{type:"doc",id:"api/web/functions/useSandbox",label:"useSandbox"},{type:"doc",id:"api/web/enumerations/Variant",label:"Variant"},{type:"doc",id:"api/web/interfaces/DataChannelOptions",label:"DataChannelOptions"},{type:"doc",id:"api/web/interfaces/JoinRoomConfig",label:"JoinRoomConfig"},{type:"doc",id:"api/web/interfaces/SimulcastConfig",label:"SimulcastConfig"},{type:"doc",id:"api/web/type-aliases/AuthErrorReason",label:"AuthErrorReason"},{type:"doc",id:"api/web/type-aliases/BandwidthLimits",label:"BandwidthLimits"},{type:"doc",id:"api/web/type-aliases/Brand",label:"Brand"},{type:"doc",id:"api/web/type-aliases/ConnectViewerConfig",label:"ConnectViewerConfig"},{type:"doc",id:"api/web/type-aliases/CustomSource",label:"CustomSource"},{type:"doc",id:"api/web/type-aliases/DataCallback",label:"DataCallback"},{type:"doc",id:"api/web/type-aliases/DeviceError",label:"DeviceError"},{type:"doc",id:"api/web/type-aliases/DeviceItem",label:"DeviceItem"},{type:"doc",id:"api/web/type-aliases/InitializeDevicesResult",label:"InitializeDevicesResult"},{type:"doc",id:"api/web/type-aliases/InitializeDevicesSettings",label:"InitializeDevicesSettings"},{type:"doc",id:"api/web/type-aliases/InitializeDevicesStatus",label:"InitializeDevicesStatus"},{type:"doc",id:"api/web/type-aliases/JoinErrorReason",label:"JoinErrorReason"},{type:"doc",id:"api/web/type-aliases/MiddlewareResult",label:"MiddlewareResult"},{type:"doc",id:"api/web/type-aliases/PeerId",label:"PeerId"},{type:"doc",id:"api/web/type-aliases/PeerStatus",label:"PeerStatus"},{type:"doc",id:"api/web/type-aliases/PeerWithTracks",label:"PeerWithTracks"},{type:"doc",id:"api/web/type-aliases/PersistLastDeviceHandlers",label:"PersistLastDeviceHandlers"},{type:"doc",id:"api/web/type-aliases/ReconnectConfig",label:"ReconnectConfig"},{type:"doc",id:"api/web/type-aliases/ReconnectionStatus",label:"ReconnectionStatus"},{type:"doc",id:"api/web/type-aliases/RoomType",label:"RoomType"},{type:"doc",id:"api/web/type-aliases/SimulcastBandwidthLimit",label:"SimulcastBandwidthLimit"},{type:"doc",id:"api/web/type-aliases/SimulcastBandwidthLimits",label:"SimulcastBandwidthLimits"},{type:"doc",id:"api/web/type-aliases/StreamConfig",label:"StreamConfig"},{type:"doc",id:"api/web/type-aliases/Track",label:"Track"},{type:"doc",id:"api/web/type-aliases/TrackBandwidthLimit",label:"TrackBandwidthLimit"},{type:"doc",id:"api/web/type-aliases/TrackId",label:"TrackId"},{type:"doc",id:"api/web/type-aliases/TrackMiddleware",label:"TrackMiddleware"},{type:"doc",id:"api/web/type-aliases/TracksMiddleware",label:"TracksMiddleware"},{type:"doc",id:"api/web/type-aliases/TracksMiddlewareResult",label:"TracksMiddlewareResult"},{type:"doc",id:"api/web/type-aliases/UseDataChannelResult",label:"UseDataChannelResult"},{type:"doc",id:"api/web/type-aliases/UseInitializeDevicesParams",label:"UseInitializeDevicesParams"},{type:"doc",id:"api/web/type-aliases/UseSandboxProps",label:"UseSandboxProps"},{type:"doc",id:"api/web/variables/SimulcastConfig",label:"SimulcastConfig"}]}]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/versioned_docs/version-0.25.0/api/web/variables/SimulcastConfig.md b/versioned_docs/version-0.25.0/api/web/variables/SimulcastConfig.md new file mode 100644 index 00000000..a17cda05 --- /dev/null +++ b/versioned_docs/version-0.25.0/api/web/variables/SimulcastConfig.md @@ -0,0 +1,5 @@ +# Variable: SimulcastConfig + +> **SimulcastConfig**: `MessageFns`\<[`SimulcastConfig`](../interfaces/SimulcastConfig.md)\> + +Defined in: ts-client/dist/index.d.mts:164 diff --git a/versioned_docs/version-0.25.0/explanation/_category_.json b/versioned_docs/version-0.25.0/explanation/_category_.json new file mode 100644 index 00000000..d34d9b78 --- /dev/null +++ b/versioned_docs/version-0.25.0/explanation/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Explanation", + "position": 4, + "link": { + "type": "generated-index", + "title": "Explanation", + "description": "Big-picture explanations of higher-level Fishjam concepts. Most useful for building understanding of a particular topic.", + "slug": "/explanation" + }, + "collapsible": false +} diff --git a/versioned_docs/version-0.25.0/explanation/agent-internals.mdx b/versioned_docs/version-0.25.0/explanation/agent-internals.mdx new file mode 100644 index 00000000..6c6bd3ae --- /dev/null +++ b/versioned_docs/version-0.25.0/explanation/agent-internals.mdx @@ -0,0 +1,106 @@ +--- +type: explanation +title: Agent Internals +sidebar_position: 5 +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; +import AgentDefinition from "../_common/agents/definition.mdx"; +import RememberToDisconnect from "../_common/agents/remember-to-disconnect.mdx"; +import Subscriptions from "../_common/agents/subscriptions.mdx"; + +# Agent Internals + +:::info +This explanation focuses on the inner workings of Fishjam Agents. +If you are looking for a tutorial that shows how to implement an agent, then you may find the [Agent Introduction](../tutorials/agents) more useful. +::: + + + +## Agent lifecycle + +There are four steps to the lifecycle of a Fishjam Agent: + +1. The agent is created in the room `roomId`. + Fishjam generates a token that the agent will use to connect to the room. +2. The agent connects to the room `roomId` via a WebSocket connection. +3. The agent receives audio from **subscribed** peers in the room `roomId`. + Subscriptions are explained in the [Peer subscriptions](#peer-subscriptions) section. +4. The agent disconnects from the room `roomId` by closing the WebSocket connection. + +We describe the steps of an agent's lifecycle in detail below. + +:::tip +The Fishjam [server SDKs](../tutorials/agents#writing-an-agent) provide a simple way to integrate with the APIs described below. +::: + +### Step 1. Creating an Agent in Fishjam + +Agents are created via the `/room/{roomId}/peer` [REST API](../api/reference#rest-api) endpoint, by setting the `type` option to `"agent"`. +An example request with [cURL](https://curl.se/) would look like: + +```bash +# [!code word:{"type"\: "agent"}] +curl -XPOST -H "Authorization: Bearer $FISHJAM_MANAGEMENT_TOKEN" \ +"https://fishjam.io/api/v1/room/$ROOM_ID/peer" \ +--json '{"type": "agent"}' +``` + +### Step 2. Connecting to the Room + +Agents connect to Fishjam by initiating a WebSocket connection on the `/socket/agent/websocket` REST API endpoint. +All communication over the WebSocket between Agent the Fishjam is done using [Protobuf messages](https://protobuf.dev/). +Check [Fishjam Protobuf reference](../api/reference#protobufs) for more info. +Once connected, the agent must authenticate with Fishjam by sending an [`AgentRequest.AuthRequest` protobuf message](../api/reference#protobufs). +An example of initiating a connection using [websocat](https://github.com/vi/websocat) and [Buf CLI](https://buf.build/docs/cli/) would look like: + +```bash +# Get the Fishjam protobuf definitions +git clone https://github.com/fishjam-cloud/protos.git + +echo "{\"authRequest\": {\"token\": \"$AGENT_TOKEN\"}}" \ +| buf convert protos/fishjam/agent_notifications.proto \ + --type="fishjam.AgentRequest" --from="-#format=json" \ +| websocat -vbn wss://fishjam.io/api/v1/connect/$FISHJAM_ID/socket/agent/websocket +``` + +In a backend application, we suggest using the [Protobuf compiler](https://protobuf.dev/installation/) to generate utilities for creating protobuf message from code. + +### Step 3. Receiving Audio + +Once connected, an agent will receive chunks of audio as [`AgentRequest.TrackData` protobuf message](../api/reference#protobufs). + +### Step 4. Sending Audio + +All further steps are done via the WebSocket connection created in [Step 2](#step-2-connecting-to-the-room). + +To send audio to an agent, you need to create an audio track first. +This is done by sending an [`AgentRequest.CreateTrack` protobuf message](../api/reference#protobufs). +Once the track is created, you can send audio to it using [`AgentRequest.TrackData` protobuf message](../api/reference#protobufs). + +### Step 5. Disconnecting from the Room + +An agent disconnects from the room by closing the WebSocket connection created in [Step 2](#step-2-connecting-to-the-room). +It may reconnect using the same token it provided in [Step 2](#step-2-connecting-to-the-room). + + + +## Peer subscriptions + + + +The subscribe option contains parameters describing the desired output format of the peer's audio stream. +This output format will be sent to connected agents. + +### Output format + +Currently, only **16-bit PCM** (raw) audio output is supported. + +### Output sample rate + +The output can have either a sample rate of **16kHz** or **24kHz**. + +The above values aim to be compatible with popular real-time AI audio APIs. +If you require a different output format, then make sure to contact us at `contact@fishjam.io`. diff --git a/versioned_docs/version-0.25.0/explanation/architecture.mdx b/versioned_docs/version-0.25.0/explanation/architecture.mdx new file mode 100644 index 00000000..7acb9338 --- /dev/null +++ b/versioned_docs/version-0.25.0/explanation/architecture.mdx @@ -0,0 +1,91 @@ +--- +type: explanation +sidebar_position: 2 +--- + +# Fishjam Architecture + +_Understanding how Fishjam works under the hood_ + +This document explains the technical architecture of Fishjam and how data flows through the system. + +## High-level Architecture + +Streaming with Fishjam is simple: you create a room, add peers to it, and start streaming. Below is a high-level overview of how Fishjam works. + +![Fishjam Data Flow](@site/static/img/architecture.svg) + +## Components Overview + +### 1. Your Backend Server + +Your application's backend server is responsible for: + +- Authenticating users +- Creating rooms using Fishjam Server SDKs +- Generating peer tokens for clients +- Managing room lifecycle and permissions + +### 2. Fishjam Media Server + +The Fishjam Media Server is the core infrastructure component that: + +- Routes audio and video streams between participants +- Handles WebRTC negotiations and connections +- Manages different room types (conference, audio-only, livestream) +- Processes and transcodes media when needed +- Enforces security policies and token validation + +### 3. Client Applications + +Client applications (React Native, React) use Fishjam Client SDKs to: + +- Connect to rooms using peer tokens +- Send and receive audio/video streams +- Handle device management (cameras, microphones) +- Manage connection state and reconnections + +## Data Flow + +### 1. Room Creation Flow + +```mermaid +sequenceDiagram + participant FM as Fishjam Media Server + participant BE as Your Backend + participant Client as Client App + + Client->>BE: Request to join room + BE->>FM: Create room (Server SDK) + FM->>BE: Return room ID + BE->>FM: Create peer (Server SDK) + FM->>BE: Return peer token + BE->>Client: Send peer token + Fishjam ID +``` + +### 2. Media Streaming Flow + +```mermaid +sequenceDiagram + participant C1 as Client 1 + participant FM as Fishjam Media Server + participant C2 as Client 2 + + C1->>FM: Connect with peer token + C2->>FM: Connect with peer token + C1->>FM: Send video/audio stream + FM->>C2: Route stream to other peers + C2->>FM: Send video/audio stream + FM->>C1: Route stream to other peers +``` + +## Next Steps + +To understand different room types in detail, see [Room Types Explained](../explanation/room-types). + +To learn about security and token management, see [Security & Token Model](../explanation/security-tokens). + +Ready to implement? Start with our tutorials: + +- [React Native Quick Start](../tutorials/react-native-quick-start) +- [Backend Quick Start](../tutorials/backend-quick-start) diff --git a/versioned_docs/version-0.25.0/explanation/data-channels.mdx b/versioned_docs/version-0.25.0/explanation/data-channels.mdx new file mode 100644 index 00000000..bd559ec2 --- /dev/null +++ b/versioned_docs/version-0.25.0/explanation/data-channels.mdx @@ -0,0 +1,51 @@ +--- +type: explanation +sidebar_position: 7 +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Data Channels + +Data channels allow you to send and receive arbitrary binary data between peers in a room. This is useful for implementing features like text chat, file sharing, game state synchronization, or real-time cursor positions. + +## Prerequisites + +Before using data channels, you must be [connected to a room](../how-to/client/connecting). Data channels only work after you have successfully joined a room. + +## Channel Types + +The SDK provides two types of data channels, each optimized for different use cases: + +### Reliable Channel + +- **Ordered delivery**: Messages arrive in the order they were sent +- **Guaranteed delivery**: All messages will be delivered, with automatic retransmission if needed +- **Use cases**: Chat messages, file transfers, commands, or any data that must not be lost + +### Lossy Channel + +- **Unordered delivery**: Messages may arrive out of order +- **No retransmission**: Messages may be dropped if the network is congested +- **Lower latency**: Faster delivery since there's no waiting for retransmissions +- **Use cases**: Real-time cursor positions, game state updates, live sensor data, or any data where the latest value matters more than every value + +## Broadcast Communication + +Data channels work in a **broadcast fashion** - when you publish data, it is sent to all other peers in the room. Additionally: + +- Messages sent on the **reliable channel** are only received by peers subscribed to the **reliable channel** +- Messages sent on the **lossy channel** are only received by peers subscribed to the **lossy channel** + +This separation allows you to use both channels simultaneously for different purposes without interference. + +## Using Data Channels + +Use the [`useDataChannel`](../api/web/functions/useDataChannel) hook to work with data channels. The typical flow is: + +1. Initialize the data channel after connecting to a room +2. Subscribe to incoming messages +3. Publish messages to other peers + +For a complete step-by-step guide on implementing text chat, see [Text Chat](../how-to/features/text-chat). diff --git a/versioned_docs/version-0.25.0/explanation/glossary.md b/versioned_docs/version-0.25.0/explanation/glossary.md new file mode 100644 index 00000000..73539dc5 --- /dev/null +++ b/versioned_docs/version-0.25.0/explanation/glossary.md @@ -0,0 +1,39 @@ +--- +type: reference +--- + +# Glossary + +A brief walk-through of the terms we use in the documentation. + +### Room + +A collection of peers that can send and receive video/audio to and from other peers. + +### Peer + +A user that is connected to a room. Each peer has some associated metadata and tracks. + +### Agent + +A program connected to a room using the Fishjam server SDK; a programmatic peer. + +### Track + +A single stream of video or audio from a peer. It could be a camera view, shared screen, or microphone audio. Each peer can stream multiple tracks. + +### Management Token + +A secret token that should be stored on your backend. It allows you to create rooms and add peers. + +### Peer Token + +A token that your backend should pass to end clients to allow access to a specific room. + +### Fishjam ID + +The ID of your Fishjam instance. It is used by your backend server to add peers to rooms (and create rooms). It is also used by end client apps to join rooms. + +### Sandbox API + +A simple testing API allowing you to test Fishjam features without requiring you to add any functionalities to your backend. As the name suggests, it's available **only** in the Sandbox environment. You can find more details [here](/how-to/features/sandbox-api-testing). diff --git a/versioned_docs/version-0.25.0/explanation/public-livestreams.mdx b/versioned_docs/version-0.25.0/explanation/public-livestreams.mdx new file mode 100644 index 00000000..c556be00 --- /dev/null +++ b/versioned_docs/version-0.25.0/explanation/public-livestreams.mdx @@ -0,0 +1,216 @@ +--- +type: explanation +title: Private vs Public Livestreams +sidebar_position: 6 +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Private vs Public Livestreams + +:::info +This explanation only applies to Fishjam rooms with type `livestream`. +::: + +When livestreaming with Fishjam, you can chose to make your livestream `private` or `public`. +By default, created livestreams are `private`, to prevent possible bugs. + + + + + ```ts + const fishjamId = ''; + const managementToken = ''; + + // ---cut--- + import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; + + const fishjamClient = new FishjamClient({ + fishjamId, + managementToken, + }); + + const privateRoom = await fishjamClient.createRoom({ roomType: 'livestream' }); // [!code highlight] + const publicRoom = await fishjamClient.createRoom({ roomType: 'livestream', public: true }); // [!code highlight] + ``` + + + + + + ```python + from fishjam import FishjamClient + + fishjam_client = FishjamClient( + fishjam_id=fishjam_id, + management_token=management_token, + ); + + private_room = fishjam_client.create_room(room_type="livestream") # [!code highlight] + public_room = fishjam_client.create_room(room_type="livestream", public=True) # [!code highlight] + ``` + + + + +The choice you make affects how **viewers** connect to the livestream and has no effect on streamers. + +## Private livestreams + +When you create a private livestream, viewers are required to provide a viewer token when connecting to the livestream. + +This aims to provide control over who can view a livestream, but requires you to distribute tokens from your backend application to your frontend applications. + +### Creating a viewer token + +Below we show how you would create a livestream viewer token in a production scenario, with your own backend. +Note that for development purposes, you can [use the Sandbox API to generate a viewer token](../tutorials/livestreaming#obtaining-a-token-1). + + + + + ```ts + const fishjamId = ''; + const managementToken = ''; + + // ---cut--- + import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; + + const fishjamClient = new FishjamClient({ + fishjamId, + managementToken, + }); + + + const privateRoom = await fishjamClient.createRoom({ roomType: 'livestream' }); + const { token: viewerToken } = await fishjamClient.createLivestreamViewerToken(privateRoom.id); // [!code highlight] + ``` + + + + + + ```python + from fishjam import FishjamClient + + fishjam_client = FishjamClient( + fishjam_id=fishjam_id, + management_token=management_token, + ); + + private_room = fishjam_client.create_room(room_type="livestream") + viewer_token = fishjam_client.create_livestream_viewer_token(private_room.id) # [!code highlight] + ``` + + + + +### Connecting to a private room + +Once you've created a viewer token, you can connect to a room using the Fishjam client SDKs (examples below), or alternatively you can use [WHEP](../how-to/features/whip-whep#private-livestreams). + + + + + ```tsx + const viewerToken = ''; + + // ---cut--- + import { useLivestreamViewer } from '@fishjam-cloud/react-client'; + + // ... + + const { connect, stream } = useLivestreamViewer(); + + // ... + + await connect({ token: viewerToken }); + // after connecting stream will be available + ``` + + + + + + ```tsx + import React from 'react'; + + const viewerToken = ''; + + // ---cut--- + import { useLivestreamViewer, RTCView } from '@fishjam-cloud/react-native-client'; + + // Inside your component: + const { connect, stream } = useLivestreamViewer(); + + // ... + + await connect({ token: viewerToken }); + + // Render the stream + {stream && } + ``` + + + + +## Public livestreams + +Public livestreams simplify the viewing process by omitting the viewer token. +All a viewer needs to view a public livestream is the ID of the room, so your backend doesn't need to manage the creation and distribution of viewer tokens. + +Note however, that public livestreams are _not suitable for all use-cases_. + +For example, if you are developing an app, which includes exclusive live content that requires a subscription to view, then you will want to authorize viewers before allowing them to view a livestream. +Failing to do so may result in extra costs, as livestreams are billed per-viewer. +Such an application will benefit from the token-based authorization in [private livestreams](#private-livestreams). + +### Connecting to a public room + +Once you've created a room of type `livestream` with the `public` flag enabled, you may start connecting viewers to the stream via the Fishjam client SDKs or [WHEP](../how-to/features/whip-whep#public-livestreams). + + + + + ```tsx + const roomId = ''; + + // ---cut--- + import { useLivestreamViewer } from '@fishjam-cloud/react-client'; + + // ... + + const { connect, stream } = useLivestreamViewer(); + + // ... + + await connect({ streamId: roomId }); + // after connecting `stream` will be available + ``` + + + + + + ```tsx + import React from 'react'; + + const roomId = ''; + + // ---cut--- + import { useLivestreamViewer, RTCView } from '@fishjam-cloud/react-native-client'; + + // Inside your component: + const { connect, stream } = useLivestreamViewer(); + + // ... + + await connect({ streamId: roomId }); + + // Render the stream + {stream && } + ``` + + + diff --git a/versioned_docs/version-0.25.0/explanation/room-types.mdx b/versioned_docs/version-0.25.0/explanation/room-types.mdx new file mode 100644 index 00000000..2257dd72 --- /dev/null +++ b/versioned_docs/version-0.25.0/explanation/room-types.mdx @@ -0,0 +1,130 @@ +--- +type: explanation +sidebar_position: 3 +--- + +# Room Types Explained + +_Understanding different types of rooms and when to use them_ + +Fishjam provides three distinct room types, each optimized for different use cases and scenarios. +Understanding these room types helps you choose the right approach for your application. + +## Conference Rooms (Default) + +### What are Conference Rooms? + +Conference rooms are the default room type designed for multi-participant video conferencing scenarios. They support all Fishjam features and provide the most flexibility. + +### Key Characteristics + +- **Multi-participant**: Support for many participants simultaneously +- **Bidirectional media**: All participants can send and receive video/audio +- **Multiple sources**: Participants can share their camera, screen, microphone and more all at once +- **Flexible track management**: Participants can add/remove tracks dynamically + +### Best Use Cases + +- **Video conferencing applications** +- **Interactive webinars** with participant engagement + +### Cost Considerations + +Conference rooms are priced based on total connection time of all peers. + +## Audio-only Rooms + +### What are Audio-only Rooms? + +Audio-only rooms are optimized specifically for voice communication, removing video capabilities to improve performance and reduce costs. + +### Key Characteristics + +- **Voice-only communication**: No video tracks allowed +- **Cheap pricing**: Audio only rooms cost much less than other room types +- **Optimized network usage**: Works well in degraded network conditions + +### Best Use Cases + +- **Audio chat applications** +- **Podcast recording** with multiple participants +- **Large-scale audio events** (town halls, announcements) + +### Cost Benefits + +Audio-only rooms come at a **75% discount** compared to conference rooms: + +- 2 peers for 30 minutes = 60 minutes total time in conference room +- Same scenario in audio-only room = 15 minutes equivalent cost + +### Video Behavior in Audio-only Rooms + +If you attempt to add video to an audio-only room: + +- Video tracks are ignored (not transmitted) +- SDKs log warnings to help with debugging +- Only audio from screen sharing is transmitted +- No errors thrown, graceful degradation + +## Livestream Rooms + +### What are Livestream Rooms? + +Livestream rooms are designed for one-to-many livestreaming scenarios where a single streamer streams to multiple viewers. + +### Key Characteristics + +- **One sender**: Only one streamer can send media +- **Many receivers**: Unlimited viewers can watch +- **Optimized for scale**: Efficient distribution architecture + +### Livestreaming Limitations + +- **Single video track**: Only one video stream allowed +- **Single audio track**: Only one audio stream allowed +- **Additional tracks ignored**: Extra tracks are not forwarded to viewers + +### Viewer Experience + +- **Configurable access**: Livestreams can either be public, where anyone with the stream's ID can join, or private, where every viewer needs a token +- **Standard compatibility**: Any [WHEP](https://blog.swmansion.com/building-interactive-streaming-apps-webrtc-whip-whep-explained-d38f4825ec90)-compatible player works + +### Best Use Cases + +- **Live events** +- **Streaming platforms** and content distribution +- **Corporate livestreams** and announcements +- **Sports and entertainment** streaming + +### Cost Benefits + +Livestream rooms are **20% cheaper** than conference rooms for equivalent usage. + +## Choosing the Right Room Type + +### Decision Matrix + +| Use Case | Room Type | Why | +| ---------------------- | ---------- | ------------------------------------------- | +| Classic video meetings | Conference | Multiple video sources | +| Voice-only meetings | Audio-only | Cheapest and most performant option | +| Live Podcasts | Audio-only | Cheapest and most performant option | +| Sport streaming | Livestream | Highly scalable and cheaper than conference | +| Interactive workshop | Conference | Multiple video sources | + +## Next Steps + +To understand how to use each room type: + +- [How to implement livestreaming](../tutorials/livestreaming) +- [How to create audio-only calls](../how-to/features/audio-only-calls) + +To learn about the underlying architecture: + +- [Fishjam Architecture](../explanation/architecture) +- [Security & Token Model](../explanation/security-tokens) + +Ready to start building? Check our tutorials: + +- [React Native Quick Start](../tutorials/react-native-quick-start) +- [Backend Quick Start](../tutorials/backend-quick-start) diff --git a/versioned_docs/version-0.25.0/explanation/sandbox-api-concept.mdx b/versioned_docs/version-0.25.0/explanation/sandbox-api-concept.mdx new file mode 100644 index 00000000..6595b42f --- /dev/null +++ b/versioned_docs/version-0.25.0/explanation/sandbox-api-concept.mdx @@ -0,0 +1,78 @@ +--- +type: explanation +sidebar_position: 1 +--- + +# What is the Sandbox API? + +The Sandbox API is a development tool that simplifies getting started with Fishjam by providing a simple backend for testing, eliminating the need to build your own server initially. + +## What can the Sandbox API do? + +The Sandbox API is an HTTP server that comes with Fishjam's Sandbox environment. +It provides basic room creation and peer management functionality without requiring you to set up your own backend infrastructure. + +### Key Characteristics + +- **Development-purposed**: Designed for initial development and testing +- **No authentication**: Simplified access for quick prototyping +- **Sandbox-only**: Only available in the Sandbox environment + +## The Problem Sandbox API Solves + +When starting with videoconferencing or livestreaming development, you typically need: + +1. A **Backend server** to create rooms +2. An **Authentication system** to manage users +3. **Token management** for secure peer access +4. **API endpoints** for your frontend to call + +This creates a problem: to test your frontend, you need a backend, but during prototyping you want to focus on frontend development first. +The Sandbox API mitigates this issue and allows you to start frontend development ASAP. + +## Relationship to Server SDKs + +The Sandbox API is essentially a simplified application built using the Fishjam Server SDKs: + +```typescript +import { FishjamClient, RoomType } from "@fishjam-cloud/js-server-sdk"; +import express from "express"; +const fishjamId = ""; +const managementToken = ""; +const app = express(); + +// ---cut--- +// What Sandbox API does internally (simplified) +const fishjamClient = new FishjamClient({ fishjamId, managementToken }); + +app.get("/", async (req: express.Request, res: express.Response) => { + const { roomName, peerName, roomType } = req.query; + + // Create or get room + const room = await fishjamClient.createRoom({ + roomType: roomType as RoomType, + }); + + // Create or get peer + const { peer, peerToken } = await fishjamClient.createPeer(room.id); + + res.json({ peerToken }); +}); +``` + +This shows you exactly what your production backend needs to do, just with proper authentication and error handling. + +## See also + +To understand how to use The Sandbox API for development: + +- [How to use The Sandbox API for testing](../how-to/features/sandbox-api-testing) + +To learn about building your own backend: + +- [Backend Quick Start Tutorial](../tutorials/backend-quick-start) +- [How to set up your server](../how-to/backend/server-setup) + +To understand the security model: + +- [Security & Token Model](../explanation/security-tokens) diff --git a/versioned_docs/version-0.25.0/explanation/security-tokens.mdx b/versioned_docs/version-0.25.0/explanation/security-tokens.mdx new file mode 100644 index 00000000..27aaf541 --- /dev/null +++ b/versioned_docs/version-0.25.0/explanation/security-tokens.mdx @@ -0,0 +1,117 @@ +--- +type: explanation +sidebar_position: 4 +--- + +# Security & Token Model + +_Understanding Fishjam's security architecture and token system_ + +Fishjam uses a token-based security model to ensure secure access control while keeping the developer experience simple. + +## Security Architecture Overview + +Fishjam's security is built on a **two-tier token system**: + +1. **Management Tokens**: For backend-to-Fishjam server communication +2. **Peer Tokens**: For client-to-Fishjam server communication + +This separation ensures that sensitive operations remain on your backend while allowing clients secure, limited access to media streaming. + +## Management Tokens + +### Purpose + +Management tokens provide your backend server with administrative access to Fishjam resources. They allow creating, managing, and deleting rooms and peers. + +### Characteristics + +- **Long-lived**: Management tokens remain valid until manually regenerated +- **High privilege**: Management tokens allow performing administrative operations and should only be used in backend applications. +- **Backend-only**: Management tokens should never be sent to client applications. +- **Environment-specific**: There are different tokens for sandbox and production. + +### What Management Tokens Can Do + +Management tokens give permission to: + +- Create and manage rooms and peers +- Setup [webhooks](../how-to/backend/server-setup#webhooks) +- Set [immutable peer metadata](../how-to/backend/server-setup#metadata) + +## Peer Tokens + +### Purpose + +Peer tokens provide client applications with limited, time-bound access to join a specific room as a specific peer. + +### Characteristics + +- **Short-lived**: Peer tokens expire 24h after creation. +- **Scope-limited**: Peer tokens give access to one specific room as one specific peer only. +- **Client-safe**: Peer tokens are safe to send to frontend applications. + +### What Peer Tokens Can Do + +Peer tokens give permission to: + +- Connect to the specific room they were issued for +- Participate in room activities (audio/video/screen sharing) +- Access peer metadata and room state + +### What Peer Tokens Cannot Do + +- Create or delete rooms +- Access multiple rooms +- Add or remove peers + +### Generation Process + +```typescript +import { FishjamClient, RoomId } from "@fishjam-cloud/js-server-sdk"; +import express from "express"; +const res = {} as any; +const managementToken = ""; +const fishjamId = ""; +const roomId = "" as unknown as RoomId; +const fishjamClient = new FishjamClient({ fishjamId, managementToken }); + +// ---cut--- +// Backend generates peer token (using management token) +const { peer, peerToken } = await fishjamClient.createPeer(roomId, { + metadata: { name: "John Doe", userId: "user-123" }, +}); + +// Backend sends peer token to client +res.json({ + peerToken, // Client uses this to connect + roomId, // Room information +}); +``` + +### Client Usage + +```typescript +import { useConnection } from "@fishjam-cloud/react-client"; +const joinRoom = {} as any; +const peerToken = ""; + +// ---cut--- +// Client uses peer token to connect (safe to use in frontend) +await joinRoom({ peerToken }); // This is safe in client code +``` + +## Next Steps + +To implement secure authentication: + +- [Backend Quick Start Tutorial](../tutorials/backend-quick-start) +- [How to set up your server](../how-to/backend/server-setup) + +To understand the broader architecture: + +- [Fishjam Architecture](../explanation/architecture) + +To learn about the Sandbox API's security limitations: + +- [Understanding the Sandbox API](../explanation/sandbox-api-concept) diff --git a/versioned_docs/version-0.25.0/explanation/what-is-fishjam.mdx b/versioned_docs/version-0.25.0/explanation/what-is-fishjam.mdx new file mode 100644 index 00000000..a2e80309 --- /dev/null +++ b/versioned_docs/version-0.25.0/explanation/what-is-fishjam.mdx @@ -0,0 +1,67 @@ +--- +type: explanation +sidebar_position: 0 +--- + +# What is Fishjam? + +_Understanding the role and purpose of Fishjam_ + +Fishjam is a multimedia streaming toolkit that allows you to build real-time video and audio streaming applications. +It uses [WebRTC](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API) under the hood to ensure sub-second (in most cases **less than 300ms**) latency. +We provide the infrastructure, media server, and client SDKs so you can focus on building your apps. + +**No WebRTC knowledge is required!** + +## The Problem Fishjam Solves + +Building real-time video and audio applications is complex. Developers typically need to: + +- Set up and manage WebRTC infrastructure +- Handle complex peer-to-peer networking +- Manage media servers and scaling +- Deal with different devices and codec compatibility +- Implement secure token-based authentication + +Fishjam abstracts away this complexity, providing a simple API and managed infrastructure. + +## What Fishjam Provides + +Fishjam consists of several components that work together to provide a seamless multimedia streaming experience: + +| Component | Description | +| --------------------- | ------------------------------------------------------------------------------------------------------- | +| Developer panel | The place to access your credentials and manage your Fishjam usage. | +| Fishjam Media Servers | Media servers route your multimedia traffic. We host and manage them for you. | +| Fishjam Client SDKs | Toolkit used for multimedia integration on endpoint devices. | +| Fishjam Server SDKs | Toolkit for integrating your backend with Fishjam. We currently support Python and NodeJS. | +| Sandbox API | Simple backend for creating test rooms. You can test Fishjam without having to set up your own backend. | + +## Use Cases + +Fishjam is ideal for: + +### Video Conferencing + +Build videoconferencing applications with multiple participants in rooms, screen sharing, and audio/video. + +### Livestreaming + +Stream live content from one streamer to many viewers with low latency. +Perfect for live events or streaming platforms. + +### Audio-only Applications + +Create voice-only experiences like audio conferencing, podcasts, or voice chat applications. + +## Next Steps + +To understand how Fishjam works technically, see [Fishjam Architecture](../explanation/architecture). + +To learn about the different types of rooms available, see [Room Types Explained](../explanation/room-types). + +Ready to start building? Check out our tutorials: + +- [React Native Quick Start](../tutorials/react-native-quick-start) +- [React Quick Start](../tutorials/react-quick-start) +- [Backend Quick Start](../tutorials/backend-quick-start) diff --git a/versioned_docs/version-0.25.0/how-to/_category_.json b/versioned_docs/version-0.25.0/how-to/_category_.json new file mode 100644 index 00000000..a932906d --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "How-to Guides", + "position": 3, + "link": { + "type": "generated-index", + "title": "How-to Guides", + "description": "Practical step-by-step guides to help you achieve a specific goal. Most useful when you're trying to get something done.", + "slug": "/how-to" + }, + "collapsible": false +} diff --git a/versioned_docs/version-0.25.0/how-to/_common/metadata/header.mdx b/versioned_docs/version-0.25.0/how-to/_common/metadata/header.mdx new file mode 100644 index 00000000..aafb60c4 --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/_common/metadata/header.mdx @@ -0,0 +1,10 @@ +Alongside audio and video, it is possible to send additional metadata with each peer. Metadata is just +JSON that can contain arbitrary information. Its most common use is sending a user name associated with a peer. +However, it can be also used to send the peer's camera type, application information etc. + +:::info + +You can also set metadata on [the server side, when adding user to the room](../../../how-to/backend/server-setup#metadata). This metadata is persistent throughout its lifetime and is useful for attaching information that +can't be overwritten by the peer, like information about real user names or basic permission info. + +::: diff --git a/versioned_docs/version-0.25.0/how-to/_common/metadata/joining_room.mdx b/versioned_docs/version-0.25.0/how-to/_common/metadata/joining_room.mdx new file mode 100644 index 00000000..517a5b30 --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/_common/metadata/joining_room.mdx @@ -0,0 +1,5 @@ +## Setting metadata when joining the room + +The `joinRoom` method from the `useConnection` hook has a `peerMetadata` parameter, that can be used for setting object metadata. + +{props.children} diff --git a/versioned_docs/version-0.25.0/how-to/_common/metadata/reading.mdx b/versioned_docs/version-0.25.0/how-to/_common/metadata/reading.mdx new file mode 100644 index 00000000..b0516650 --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/_common/metadata/reading.mdx @@ -0,0 +1,9 @@ +## Reading metadata + +Peer metadata is available as the `metadata` property for each peer. Therefore, when you list your peers with the `usePeers` hook, you can read +the metadata associated with them. +Note that the `metadata.peer` property contains only the metadata set by the client SDK (as in the examples examples above). +The metadata set on the server side is available as `metadata.server`. +Learn more about server metadata [here](../backend/server-setup#metadata). + +{props.children} diff --git a/versioned_docs/version-0.25.0/how-to/_common/metadata/updating.mdx b/versioned_docs/version-0.25.0/how-to/_common/metadata/updating.mdx new file mode 100644 index 00000000..97bd1a1b --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/_common/metadata/updating.mdx @@ -0,0 +1,5 @@ +## Updating metadata during connection + +Once you've joined the room, you can update your peer metadata with the `updatePeerMetadata` method of the `useUpdatePeerMetadata` hook: + +{props.children} diff --git a/versioned_docs/version-0.25.0/how-to/backend/_category_.json b/versioned_docs/version-0.25.0/how-to/backend/_category_.json new file mode 100644 index 00000000..2d5af2e1 --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/backend/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Backend", + "position": 4 +} diff --git a/versioned_docs/version-0.25.0/how-to/backend/fastapi-example.mdx b/versioned_docs/version-0.25.0/how-to/backend/fastapi-example.mdx new file mode 100644 index 00000000..3564cc26 --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/backend/fastapi-example.mdx @@ -0,0 +1,99 @@ +--- +sidebar_position: 1 +title: FastAPI +--- + +# FastAPI example + +The example assumes you've already installed [**our SDK**](https://github.com/fishjam-cloud/python-server-sdk) and you're ready to go. +If you wish to see more general info, visit [**Set up your server**](../../how-to/backend/server-setup) article. + +## Minimal setup + +The same way as in the [**FastAPI docs**](https://fastapi.tiangolo.com/tutorial/first-steps/), the code below can be copied and run immediately. +Just make sure you set `FISHJAM_ID` and `FISHJAM_MANAGEMENT_TOKEN` environment variables. +The `Depends` function allows the `FishjamClient` to be provided to the route function as a dependency, which avoids code duplication and allows easy mocking. + +```python +import os +from typing import Annotated +from fastapi import Depends, FastAPI +from fishjam import FishjamClient + + +app = FastAPI() + +def fishjam_client(): + fishjam_id = os.environ["FISHJAM_ID"] + management_token = os.environ["FISHJAM_MANAGEMENT_TOKEN"] + return FishjamClient(fishjam_id=fishjam_id, management_token=management_token) + + +@app.get("/") +async def get_rooms(fishjam_client: Annotated[FishjamClient, Depends(fishjam_client)]): + rooms = fishjam_client.get_all_rooms() + return {"rooms": rooms} +``` + +## Listening to events + +Fishjam instance is a stateful server that is emitting messages upon certain events. +You can listen for those messages and react as you prefer. +There are two options for obtaining these. + +### Webhooks + +To receive and parse Fishjam protobuf messages, create a dependable function that parses the request body using the `receive_binary` function from the `fishjam` package. +Then, you will be able to use pattern matching to respond to different kinds of events. + +```python +from fastapi import Depends, FastAPI, HTTPException, Request +from fishjam import receive_binary +from fishjam.events import ServerMessagePeerAdded + +app = FastAPI() + +async def parse_fishjam_message(request: Request): + binary = await request.body() + if message := receive_binary(binary): + return message + raise HTTPException(status_code=400, detail="Invalid Fishjam message") + +@app.post("/fishjam-webhook") +async def fishjam_webhook(fishjam_message = Depends(parse_fishjam_message)): + match fishjam_message: + case ServerMessagePeerAdded(): + print(f"Peer added: {fishjam_message.peer_id}") + case _: + ... +``` + +### SDK Notifier + +Use the `asyncio` library to run the SDK notifier. +It doesn't interact with the FastAPI library per se, just start the event loop and it will run alongside the server. + +```python +import asyncio +from fishjam import FishjamNotifier + +notifier = FishjamNotifier(server_address=fishjam_id, server_api_token=management_token) + +@notifier.on_server_notification +def handle_notification(notification): + match notification: + case ServerMessagePeerAdded(): + print(f"Peer added: {notification.peer_id}") + case _: + ... + +async def run_notifier(): + notifier_task = asyncio.create_task(notifier.connect()) + + # Wait for the notifier to be ready to receive messages + await notifier.wait_ready() + + await notifier_task + +asyncio.run(run_notifier()) +``` diff --git a/versioned_docs/version-0.25.0/how-to/backend/fastify-example.mdx b/versioned_docs/version-0.25.0/how-to/backend/fastify-example.mdx new file mode 100644 index 00000000..2fd837c4 --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/backend/fastify-example.mdx @@ -0,0 +1,239 @@ +--- +sidebar_position: 0 +title: Fastify +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Fastify example + +The example assumes you've already installed [**our SDK**](https://www.npmjs.com/package/@fishjam-cloud/js-server-sdk) and you're ready to go. +If you wish to see more general info, visit [**set up your server**](../../how-to/backend/server-setup) article. + +## Load environment variables to Fastify + +Use [`@fastify/env` package](https://github.com/fastify/fastify-env) to load and set environment variables in your Fastify instance. + +```ts title='main.ts' +import Fastify from "fastify"; +import fastifyEnv from "@fastify/env"; + +const fastify = Fastify(); + +const envSchema = { + type: "object", + required: ["FISHJAM_ID", "FISHJAM_MANAGEMENT_TOKEN"], + properties: { + FISHJAM_ID: { + type: "string", + }, + FISHJAM_MANAGEMENT_TOKEN: { + type: "string", + }, + }, +}; + +await fastify.register(fastifyEnv, { schema: envSchema }); + +fastify.listen({ port: 3000 }); +``` + +## Setup Fishjam Fastify plugin + +Fastify allows you to create plugins to encapsulate functionality in scopes. +Check out [fastify documentation](https://fastify.dev/docs/latest/Reference/Plugins) for a deeper understanding of the concept. + +First, extend the `FastifyInstance` interface with `fishjam` entry. +This will provide types of FishjamClient wherever you access `fastify.fishjam` in the codebase. +Then, declare the plugin by invoking the `fp` function with the setup function with as an argument. + +```ts title='fishjamPlugin.ts' +import fastifyPlugin from "fastify-plugin"; +import { FishjamClient } from "@fishjam-cloud/js-server-sdk"; + +declare module "fastify" { + interface FastifyInstance { + fishjam: FishjamClient; + config: { + FISHJAM_ID: string; + FISHJAM_MANAGEMENT_TOKEN: string; + }; + } +} + +export const fishjamPlugin = fastifyPlugin((fastify) => { + const fishjamClient = new FishjamClient({ + fishjamId: fastify.config.FISHJAM_ID, + managementToken: fastify.config.FISHJAM_MANAGEMENT_TOKEN, + }); + + fastify.decorate("fishjam", fishjamClient); +}); +``` + +Now, after registering the plugin, we will be able to use Fishjam client by accessing the `fastify.fishjam` property. + +```ts title='main.ts' +import fastifyPlugin from "fastify-plugin"; +import { FishjamClient } from "@fishjam-cloud/js-server-sdk"; +import Fastify from "fastify"; + +declare module "fastify" { + interface FastifyInstance { + fishjam: FishjamClient; + config: { + FISHJAM_ID: string; + FISHJAM_MANAGEMENT_TOKEN: string; + }; + } +} + +export const fishjamPlugin = fastifyPlugin((fastify) => { + const fishjamClient = new FishjamClient({ + fishjamId: fastify.config.FISHJAM_ID, + managementToken: fastify.config.FISHJAM_MANAGEMENT_TOKEN, + }); + + fastify.decorate("fishjam", fishjamClient); +}); + +const fastify = Fastify(); + +// ---cut--- +await fastify.register(fishjamPlugin); + +fastify.get("/rooms", () => fastify.fishjam.getAllRooms()); + +fastify.listen({ port: 3000 }); +``` + +## Listening to events + +Fishjam instance is a stateful server that is emitting messages upon certain events. +You can listen for those messages and react as you prefer. +There are two options to obtain these. + +### Webhooks + +To receive and parse the Fishjam protobuf messages, add a content type parser to your global (or scoped) Fastify instance. +Then, you will be able to access the parsed message at `request.Body`. + +```ts title='main.ts' +import Fastify, { FastifyRequest } from "fastify"; +import { ServerMessage } from "@fishjam-cloud/js-server-sdk"; + +const fastify = Fastify(); + +fastify.addContentTypeParser( + "application/x-protobuf", + { parseAs: "buffer" }, + async (_: FastifyRequest, body: Buffer) => + ServerMessage.decode(new Uint8Array(body)), +); + +fastify.post<{ Body: ServerMessage }>("/fishjam-webhook", (request) => { + // handle the message + console.log(request.body); +}); +``` + +### SDK Notifier + +You can also leverage the Fastify plugin mechanism to use websockets to receive messages from Fishjam. +Let's create another plugin in `fishjamNotifierPlugin.ts` file. + +In this case, we don't need to extend the Fastify instance type, because the plugin doesn't decorate the Fastify instance with any properties. It will work in the background. + +```ts title='fishjamNotifierPlugin.ts' +import fastifyPlugin from "fastify-plugin"; +import { FishjamClient } from "@fishjam-cloud/js-server-sdk"; +import Fastify from "fastify"; + +declare module "fastify" { + interface FastifyInstance { + fishjam: FishjamClient; + config: { + FISHJAM_ID: string; + FISHJAM_MANAGEMENT_TOKEN: string; + }; + } +} + +export const fishjamPlugin = fastifyPlugin((fastify) => { + const fishjamClient = new FishjamClient({ + fishjamId: fastify.config.FISHJAM_ID, + managementToken: fastify.config.FISHJAM_MANAGEMENT_TOKEN, + }); + + fastify.decorate("fishjam", fishjamClient); +}); + +const fastify = Fastify(); + +// ---cut--- +import { type FastifyInstance } from "fastify"; +import fp from "fastify-plugin"; +import { FishjamWSNotifier } from "@fishjam-cloud/js-server-sdk"; + +export const fishjamNotifierPlugin = fp((fastify) => { + const fishjamId = fastify.config.FISHJAM_ID; + const managementToken = fastify.config.FISHJAM_MANAGEMENT_TOKEN; + + const fishjamNotifier = new FishjamWSNotifier( + { fishjamId, managementToken }, + (err) => fastify.log.error(err), + () => fastify.log.info("Websocket connection to Fishjam closed"), + ); + + // handle the messages + const handleRoomCreated = console.log; + const handlePeerAdded = console.log; + + fishjamNotifier.on("roomCreated", handleRoomCreated); + fishjamNotifier.on("peerAdded", handlePeerAdded); +}); +``` + +Don't forget to register your plugin. + +```ts title='main.ts' +import fastifyPlugin from "fastify-plugin"; +import { FishjamClient } from "@fishjam-cloud/js-server-sdk"; +import Fastify from "fastify"; +import { FishjamWSNotifier } from "@fishjam-cloud/js-server-sdk"; + +declare module "fastify" { + interface FastifyInstance { + fishjam: FishjamClient; + config: { + FISHJAM_ID: string; + FISHJAM_MANAGEMENT_TOKEN: string; + }; + } +} + +export const fishjamPlugin = fastifyPlugin((fastify) => { + const fishjamClient = new FishjamClient({ + fishjamId: "aaa", + managementToken: "bbb", + }); + + fastify.decorate("fishjam", fishjamClient); +}); + +const fastify = Fastify(); + +const fishjamNotifierPlugin = fastifyPlugin((fastify) => { + const fishjamNotifier = new FishjamWSNotifier( + { fishjamId: "aaa", managementToken: "bbb" }, + (err) => fastify.log.error(err), + (_code, _reason) => + fastify.log.info("Websocket connection to Fishjam closed"), + ); +}); + +// ---cut--- +await fastify.register(fishjamPlugin); +await fastify.register(fishjamNotifierPlugin); +``` diff --git a/versioned_docs/version-0.25.0/how-to/backend/production-deployment.mdx b/versioned_docs/version-0.25.0/how-to/backend/production-deployment.mdx new file mode 100644 index 00000000..7be6b05d --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/backend/production-deployment.mdx @@ -0,0 +1,297 @@ +--- +type: how-to +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# How to Deploy Fishjam to Production + +**How-to Guide** - _Deploy your Fishjam backend safely to production_ + +This guide covers the essential steps to move from development (using the Sandbox API) to a production-ready Fishjam backend deployment. + +## Prerequisites + +- Working Fishjam backend (see [Backend Quick Start](../../tutorials/backend-quick-start)) +- Production Fishjam environment (not Sandbox) +- Domain and SSL certificates for your backend +- Production database and infrastructure + +## Step 1: Set up production Fishjam environment + +### Get production credentials + +1. Log in to [Fishjam Dashboard](https://fishjam.io/app) +2. Create or select your **Production** environment (not Sandbox) +3. Copy your production **Fishjam ID** and **Management Token** +4. Note: These are different from your sandbox credentials + +### Environment variables setup + +Create production environment variables: + +```bash +# Production Fishjam credentials +FISHJAM_ID="your-production-fishjam-id" +FISHJAM_MANAGEMENT_TOKEN="your-production-management-token" + +# Your application settings +NODE_ENV="production" +PORT="3000" +DATABASE_URL="your-production-database-url" + +# Security settings +JWT_SECRET="your-secure-jwt-secret" +CORS_ORIGIN="https://yourdomain.com" +``` + +## Step 2: Implement proper authentication + +### Replace Sandbox API calls + +Remove any Sandbox API dependencies from your client code: + +```typescript +// @noErrors: 2451 +import { useSandbox } from "@fishjam-cloud/react-client"; +import express from "express"; + +const authenticateUser = {} as any; +const app = express(); + +const { getSandboxPeerToken } = useSandbox(); + +const userToken = ""; +const roomName = ""; +const userName = ""; + +// ---cut--- +// ❌ Remove: Sandbox API calls +const peerToken = await getSandboxPeerToken(roomName, userName); + +// ✅ Replace with: Your authenticated API +const response = await fetch("https://your-backend.com/api/join-room", { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${userToken}`, + }, + body: JSON.stringify({ roomName, userName }), +}); +``` + +### Implement user authentication + +```typescript +// @noErrors: 2339 +const jwt = {} as any; +import { FishjamClient, Room } from "@fishjam-cloud/js-server-sdk"; +import express from "express"; + +const app = express(); +const getUserById = async (userId: string) => ({ + id: userId, + name: "User", + avatar: "", + role: "user", +}); +const getOrCreateRoom = async (roomName: string) => + ({ id: "room-id" }) as unknown as Room; +const canUserJoinRoom = (user: any, room: any) => true; +process.env.FISHJAM_ID = ""; +process.env.FISHJAM_MANAGEMENT_TOKEN = ""; +process.env.JWT_SECRET = ""; + +// ---cut--- +const fishjamClient = new FishjamClient({ + fishjamId: process.env.FISHJAM_ID!, + managementToken: process.env.FISHJAM_MANAGEMENT_TOKEN!, +}); + +// Authentication middleware +const authenticateUser = async ( + req: express.Request, + res: express.Response, + next: express.NextFunction, +) => { + try { + const token = req.headers.authorization?.replace("Bearer ", ""); + if (!token) { + return res.status(401).json({ error: "Authentication required" }); + } + + const decoded = jwt.verify(token, process.env.JWT_SECRET); + req.user = await getUserById(decoded.userId); + next(); + } catch (error) { + res.status(401).json({ error: "Invalid token" }); + } +}; + +// Protected endpoint for joining rooms +app.post("/api/join-room", authenticateUser, async (req, res) => { + try { + const { roomName } = req.body; + const user = req.user; + + // Create or get room + const room = await getOrCreateRoom(roomName); + + // Verify user has permission to join this room + if (!canUserJoinRoom(user, room)) { + return res.status(403).json({ error: "Access denied" }); + } + + // Create peer with user metadata + const { peer, peerToken } = await fishjamClient.createPeer(room.id, { + metadata: { + userId: user.id, + name: user.name, + avatar: user.avatar, + role: user.role, + }, + }); + + res.json({ peerToken }); + } catch (error) { + console.error("Join room error:", error); + res.status(500).json({ error: "Failed to join room" }); + } +}); +``` + +## (Optional) Step 3: Handle webhooks and events + +You may wish to receive events from Fishjam regarding created rooms and peers. +All you need for this is a single api endpoint: + +### Webhook endpoint + +```typescript +import express from "express"; +const crypto = {} as any; +const app = express(); + +const handlePeerConnected = {} as any; +const handlePeerDisconnected = {} as any; +const handleRoomEmpty = {} as any; + +// ---cut--- +// Webhook signature verification +const verifyWebhookSignature = ( + req: express.Request, + res: express.Response, + next: express.NextFunction, +) => { + const signature = req.headers["x-fishjam-signature"]; + const payload = JSON.stringify(req.body); + + const expectedSignature = crypto + .createHmac("sha256", process.env.WEBHOOK_SECRET) + .update(payload, "utf8") + .digest("hex"); + + if (signature !== expectedSignature) { + return res.status(401).json({ error: "Invalid signature" }); + } + + next(); +}; + +// Webhook handler +app.post( + "/api/webhooks/fishjam", + express.raw({ type: "application/json" }), + verifyWebhookSignature, + (req: express.Request, res: express.Response) => { + const event = req.body; + + switch (event.type) { + case "peer_connected": + handlePeerConnected(event.data); + break; + case "peer_disconnected": + handlePeerDisconnected(event.data); + break; + case "room_empty": + handleRoomEmpty(event.data); + break; + default: + console.log("Unhandled event type:", event.type); + } + + res.status(200).json({ received: true }); + }, +); +``` + +### Enabling webhooks + +Now, with your endpoint setup, all you need to do is supply your webhook endpoint to Fishjam when creating a room: + +```typescript +import { FishjamClient } from "@fishjam-cloud/js-server-sdk"; +const fishjamClient = {} as any; + +// ---cut--- +const createRoomWithWebhooks = async ( + roomName: string, + roomType = "conference", +) => { + const room = await fishjamClient.createRoom({ + roomType, + webhookUrl: `${process.env.BASE_URL}/api/webhooks/fishjam`, + }); + + return room; +}; +``` + +## Common production issues + +### Issue: Token expiration handling + +Peer tokens expire 24h after creation. +We encourage keeping room and peer lifetimes as short as possible +(typically a single room corresponds to a single video call or stream). +However, if you wish to reuse a single peer over multiple days, you can make use of token refreshing: + + + + + ```ts + import { FishjamClient, RoomId, PeerId } from "@fishjam-cloud/js-server-sdk"; + const fishjamClient = new FishjamClient({ + fishjamId: "", + managementToken: "", + }); + const roomId = "" as RoomId; + const peerId = "" as PeerId; + + // ---cut--- + const newToken = fishjamClient.refreshPeerToken(roomId, peerId); + ``` + + + + + + ```python + new_token = fishjam_client.refresh_peer_token(room_id, peer_id) + ``` + + + + +## See also + +For scaling considerations: + +- [Understanding Fishjam Architecture](../../explanation/architecture) +- [Security best practices](../../explanation/security-tokens) + +For specific backend frameworks: + +- [FastAPI example](../../how-to/backend/fastapi-example) +- [Fastify example](../../how-to/backend/fastify-example) diff --git a/versioned_docs/version-0.25.0/how-to/backend/server-setup.mdx b/versioned_docs/version-0.25.0/how-to/backend/server-setup.mdx new file mode 100644 index 00000000..84903f39 --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/backend/server-setup.mdx @@ -0,0 +1,294 @@ +--- +sidebar_position: 0 +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Set up your server + +## Install the SDK + +Install the SDK for the language of your choice. We provide libraries for [**Node**](https://github.com/fishjam-cloud/js-server-sdk) and [**Python**](https://github.com/fishjam-cloud/python-server-sdk). +It's also possible to use the bare REST API, in this case you can skip this step. + + + + + ```bash + npm install @fishjam-cloud/js-server-sdk + ``` + + + + + + ```bash + yarn add @fishjam-cloud/js-server-sdk + ``` + + + + + + ```bash + pip install fishjam-server-sdk + ``` + + + + + + ```bash + poetry add fishjam-server-sdk + ``` + + + + +## Setup your client + +Let's setup everything you need to start communicating with a Fishjam instance. +First of all, view your app in the [**Fishjam developer panel**](https://fishjam.io/app) and copy your **Fishjam ID** and the **Management Token**. +They are required to proceed. Now, we are ready to dive into the code. + + + + + ```ts + process.env.FISHJAM_ID = "aaa"; + process.env.FISHJAM_MANAGEMENT_TOKEN = "bbb"; + + // ---cut--- + import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; + + const fishjamId = process.env.FISHJAM_ID; + const managementToken = process.env.FISHJAM_MANAGEMENT_TOKEN; + + const fishjamClient = new FishjamClient({ fishjamId, managementToken }); + ``` + + + + + + ```python + import os + from fishjam import FishjamClient + + fishjam_id = os.environ["FISHJAM_ID"] + management_token = os.environ["FISHJAM_MANAGEMENT_TOKEN"] + + fishjam_client = FishjamClient(fishjam_id, management_token) + ``` + + + + +### Managing rooms + +Create a room to get the `roomId` and be able to start adding peers. + + + + + ```ts + import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; + const fishjamClient = new FishjamClient({ + + fishjamId: "https://fishjam.io", + managementToken: "bbb", + }); + // ---cut--- + const createdRoom = await fishjamClient.createRoom(); + + const theSameRoom = await fishjamClient.getRoom(createdRoom.id); + + await fishjamClient.deleteRoom(theSameRoom.id) + + // puff, it's gone! + ``` + + + + + + ```python + created_room = fishjam_client.create_room() + + the_same_room = fishjam_client.get_room(created_room.id) + + fishjam_client.delete_room(the_same_room.id) + + # puff, it's gone! + ``` + + + + + +### Managing peers + +Create a peer to obtain the peer token allowing your user to join the room. +At any time you can terminate user's access by deleting the peer. + + + + + ```ts + import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; + const fishjamClient = new FishjamClient({ + fishjamId: "https://fishjam.io", + managementToken: "bbb", + }); + const created_room = await fishjamClient.createRoom(); + // ---cut--- + const { peer, peerToken } = await fishjamClient.createPeer(created_room.id); + + await fishjamClient.deletePeer(created_room.id, peer.id); + ``` + + + + + + ```python + peer, token = fishjam_client.create_peer(room_id) + + fishjam_client.delete_peer(room_id, peer.id) + ``` + + + + + +#### Metadata + +When creating a peer, you can also assign metadata to that peer, which can be read later with the [client SDK](../../how-to/client/metadata). This metadata can be only set when creating the peer and can't be updated later. + + + + + ```ts + import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; + const fishjamClient = new FishjamClient({ + fishjamId: "https://fishjam.io", + managementToken: "bbb", + }); + const created_room = await fishjamClient.createRoom(); + // ---cut--- + const { peer, peerToken } = await fishjamClient.createPeer(created_room.id, { + metadata: { realName: 'Tom Reeves' }, + }); + ``` + + + + + + ```py + options = PeerOptions( + metadata={"realName": "Tom Reeves"}, + ) + peer, token = self.fishjam_client.create_peer(room_id, options=options) + ``` + + + + +## Listening to events + +Fishjam instance is a stateful server that is emitting messages upon certain events. +You can listen for those messages and react as you prefer. +There are two options to obtain these. + +### Webhooks + +Simply pass the your webhook url as a `webhookUrl` parameter when creating a room. + + + + + ```ts + import { FishjamClient } from '@fishjam-cloud/js-server-sdk'; + + const fishjamClient = new FishjamClient({ + fishjamId: "https://fishjam.io", + managementToken: "bbb", + }); + // ---cut--- + const webhookUrl = "https://example.com/"; + await fishjamClient.createRoom({ webhookUrl }); + ``` + + + + + + ```python + from fishjam import RoomOptions + + options = RoomOptions(webhook_url="https://example.com/") + + fishjam_client.create_room(options) + ``` + + + + + +### SDK Notifier + +Our SDKs come equipped with a Notifier allowing you to subscribe for messages. +It sets up a websocket connection with a Fishjam instance and provides a simple interface allowing you to handle messages. + + + + + ```ts + const fishjamId = "https://fishjam.io"; + const managementToken = "bbb"; + // ---cut--- + import { FishjamWSNotifier } from '@fishjam-cloud/js-server-sdk'; + + const onClose = console.log; + const onError = console.error; + const onConnectionFailed = console.error; + + const fishjamNotifier = new FishjamWSNotifier({ fishjamId, managementToken }, onError, onClose); + + fishjamNotifier.on('roomCreated', console.log); + ``` + + + + + + ```python + import asyncio + from fishjam import FishjamNotifier + + notifier = FishjamNotifier(fishjam_id, management_token) + + @notifier.on_server_notification + def handle_notification(notification): + match notification: + case ServerMessageRoomCreated(): + print(notification) + case _: + ... + + async def run_notifier(): + notifier_task = asyncio.create_task(notifier.connect()) + + # Wait for notifier to be ready to receive messages + await notifier.wait_ready() + + await notifier_task + + asyncio.run(run_notifier()) + ``` + + + + diff --git a/versioned_docs/version-0.25.0/how-to/client/_category_.json b/versioned_docs/version-0.25.0/how-to/client/_category_.json new file mode 100644 index 00000000..ce35362b --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/client/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "Web & Mobile", + "position": 1, + "link": { + "type": "generated-index", + "description": "Learn how to integrate Fishjam into your web and mobile applications." + } +} diff --git a/versioned_docs/version-0.25.0/how-to/client/background-streaming.mdx b/versioned_docs/version-0.25.0/how-to/client/background-streaming.mdx new file mode 100644 index 00000000..eb6e47d8 --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/client/background-streaming.mdx @@ -0,0 +1,227 @@ +--- +sidebar_position: 13 +sidebar_label: "Background calls 📱" +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Background calls Mobile + +:::note +This guide is exclusively for **Mobile** (React Native) applications. +::: + +Both Android and iOS support calls running in the background, but they use different approaches: + +- **Android**: Uses foreground services to keep the app active in the background +- **iOS**: Uses CallKit integration to maintain VoIP calls in the background + +Below is configuration required to make it work: + + + + + +You need to modify `app.json` file and add our plugin: + +```json +{ + "expo": { + ... + "plugins": { + ... + [ + "@fishjam-cloud/react-native-client", + { + "android": { + "enableForegroundService": true + }, + "ios": { + "enableVoIPBackgroundMode": true + } + } + ], + ... + } + } +} +``` + + + + +**Android Configuration** + +Add the following permissions and services to `AndroidManifest.xml`: + +```xml title='AndroidManifest.xml' + + ... + + + + + + ... + + + + + +``` + +**iOS Configuration** + +You need to add VoIP background mode in `Info.plist`: + +```xml title='Info.plist' +UIBackgroundModes + + voip + +``` + + + + +## Usage + + + + + +You can use [`useForegroundService`](../../api/mobile/variables/useForegroundService) hook to handle how foreground service behaves on Android. + +:::important[Permissions] + +If you want to use [`enableCamera`](../../api/mobile/type-aliases/ForegroundServiceConfig#enablecamera) or [`enableMicrophone`](../../api/mobile/type-aliases/ForegroundServiceConfig#enablemicrophone), +user must first grant permission for this resource. [`useForegroundService`](../../api/mobile/variables/useForegroundService) will check if permission is +granted and only then allow to start a service. + +::: + +```tsx +import { + useForegroundService, + useCamera, + useMicrophone, +} from "@fishjam-cloud/react-native-client"; + +const { isCameraOn } = useCamera(); +const { isMicrophoneOn } = useMicrophone(); + +useForegroundService({ + // [!code highlight] + channelId: "io.fishjam.example.fishjamchat.foregroundservice.channel", + channelName: "Fishjam Chat Notifications", + notificationTitle: "Your video call is ongoing", + notificationContent: "Tap to return to the call.", + enableCamera: isCameraOn, + enableMicrophone: isMicrophoneOn, + // enableScreenSharing: true, +}); +``` + + + + +On iOS, background calls are achieved through CallKit integration. You can use the CallKit hooks to manage VoIP calls that continue running in the background. + +### Manual CallKit Management + +Use the [`useCallKit`](../../api/mobile/variables/useCallKit) hook for fine-grained control over CallKit sessions: + +```tsx +import { useCallKit } from "@fishjam-cloud/react-native-client"; + +const { startCallKitSession, endCallKitSession } = useCallKit(); + +// Start CallKit session when joining a room +const handleJoinRoom = async () => { + await startCallKitSession({ + displayName: "John Doe", + isVideo: true, + }); + // ... join room logic +}; + +// End CallKit session when leaving +const handleLeaveRoom = async () => { + await endCallKitSession(); + // ... leave room logic +}; +``` + +### Automatic CallKit Management + +Use the [`useCallKitService`](../../api/mobile/variables/useCallKitService) hook for automatic session lifecycle management: + +```tsx +import React from "react"; +import { useCallKitService } from "@fishjam-cloud/react-native-client"; +import { View } from "react-native"; + +function CallScreen({ username }: { username: string }) { + // CallKit session automatically starts when component mounts + // and ends when component unmounts + useCallKitService({ + displayName: username, + isVideo: true, + }); + + return ...; +} +``` + +### Listening to CallKit Events + +Use the [`useCallKitEvent`](../../api/mobile/variables/useCallKitEvent) hook to respond to user interactions with the native CallKit interface: + +```tsx +import { + useCallKitEvent, + useCamera, + useMicrophone, + useConnection, +} from "@fishjam-cloud/react-native-client"; + +const { startMicrophone, stopMicrophone } = useMicrophone(); +const { leaveRoom } = useConnection(); + +// Listen for mute toggle from CallKit UI +useCallKitEvent("muted", (isMuted?: boolean) => { + if (isMuted === true) { + stopMicrophone(); + } else if (isMuted === false) { + startMicrophone(); + } +}); + +// Listen for hold state changes +useCallKitEvent("held", (isHeld?: boolean) => { + console.log("Call hold state:", isHeld); + // Handle hold state in your app +}); + +// Listen for call end from CallKit UI +useCallKitEvent("ended", () => { + // Handle call termination + leaveRoom(); +}); +``` + + + + +## See Also + +For an enhanced user experience when your app is in the background, consider enabling [Picture in Picture](./picture-in-picture), which allows users to see video content in a floating window while using other apps. diff --git a/versioned_docs/version-0.25.0/how-to/client/connecting.mdx b/versioned_docs/version-0.25.0/how-to/client/connecting.mdx new file mode 100644 index 00000000..f112ec66 --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/client/connecting.mdx @@ -0,0 +1,173 @@ +--- +sidebar_position: 3 +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Connecting + +This article will guide you through the process of connecting to a Fishjam room. + +## Getting URL and token + +In order to connect, you need to obtain a **Peer Token** (the token that will authenticate the peer in +your Room). + + + + + +Once you create your account on [Fishjam](https://fishjam.io), you will have access to the Sandbox environment as part of the Mini Jar plan. +While using the Sandbox environment, [you can use the Sandbox API](../features/sandbox-api-testing) to generate peer tokens for testing or development purposes. +This is basically a service that will create a Room, add your app as +the Room's Peer, and return the token required to use that Room. + + + + +```ts +import { useSandbox } from "@fishjam-cloud/react-client"; +const roomName = "room"; +const peerName = "user"; +// ---cut--- + +// The `useSandbox` hook gets the fishjamId from FishjamProvider +// It will work ONLY with the FISHJAM_ID of the Sandbox environment +const { getSandboxPeerToken } = useSandbox(); +const peerToken = await getSandboxPeerToken(roomName, peerName); +``` + + + + +```ts +import { useSandbox } from "@fishjam-cloud/react-native-client"; +const roomName = "room"; +const peerName = "user"; +// ---cut--- + +// The `useSandbox` hook gets the fishjamId from FishjamProvider +// It will work ONLY with the FISHJAM_ID of the Sandbox environment +const { getSandboxPeerToken } = useSandbox(); +const peerToken = await getSandboxPeerToken(roomName, peerName); +``` + + + + + + + +For the production app, you need to implement your own backend service that will provide the user with a **Peer Token**. To do that, +follow our [server setup instructions](../backend/server-setup). + + + + +## Connecting + +Use the [`useConnection`](../../api/web/functions/useConnection) hook to get +the [`joinRoom`](../../api/web/functions/useConnection#joinroom) function. + + + + +```tsx +const PEER_TOKEN = "some-peer-token"; +// ---cut-before--- +import { useConnection, useSandbox } from "@fishjam-cloud/react-client"; +import React, { useCallback } from "react"; + +export function JoinRoomButton() { + const { joinRoom } = useConnection(); // [!code highlight] + // get the peer token from sandbox or your backend + const { getSandboxPeerToken } = useSandbox(); + + const onJoinRoomPress = useCallback(async () => { + // [!code highlight:5] + const peerToken = await getSandboxPeerToken("Room", "User"); + await joinRoom({ peerToken }); + }, [joinRoom]); + + return ; +} +``` + + + + +```tsx +import React, { useCallback } from "react"; +import { Button } from "react-native"; +import { useConnection, useSandbox } from "@fishjam-cloud/react-native-client"; + +export function JoinRoomButton() { + const { joinRoom } = useConnection(); // [!code highlight] + // fishjamId is provided through FishjamProvider + const { getSandboxPeerToken } = useSandbox(); + + const onPressJoin = useCallback(async () => { + // in production environment, get the peerToken from your backend + const peerToken = await getSandboxPeerToken("Room", "User"); + + await joinRoom({ peerToken }); // [!code highlight] + }, [joinRoom, getSandboxPeerToken]); + + return ; +} +``` + + + + +```tsx +import React, { useCallback } from "react"; +import { Button } from "react-native"; +import { useConnection } from "@fishjam-cloud/react-native-client"; + +export function LeaveRoomButton() { + const { leaveRoom } = useConnection(); // [!code highlight] + + const onPressLeave = useCallback(async () => { + await leaveRoom(); // [!code highlight] + }, [leaveRoom]); + + return + + ))} + + ); +} +``` + + + + +To select the desired camera, use the [`selectCamera`](../../api/mobile/functions/useCamera#selectcamera) method. +The list of the available camera devices is available via the [`cameraDevices`](../../api/mobile/functions/useCamera#cameradevices). + +```tsx +import React, { useCallback, useState } from "react"; +import { Button } from "react-native"; +import { useCamera } from "@fishjam-cloud/react-native-client"; + +export function FlipButton() { + const { cameraDevices, selectCamera } = useCamera(); // [!code highlight] + const [currentIndex, setCurrentIndex] = useState(0); + + const onPressFlipCamera = useCallback(() => { + if (cameraDevices.length === 0) return; + + // Cycle through available cameras + const nextIndex = (currentIndex + 1) % cameraDevices.length; + const nextCamera = cameraDevices[nextIndex]; + if (nextCamera) { + selectCamera(nextCamera.deviceId); // [!code highlight] + setCurrentIndex(nextIndex); + } + }, [cameraDevices, currentIndex, selectCamera]); + + return ; +} +``` + + + + +You can use [`toggleCamera`](../../api/mobile/functions/useCamera#togglecamera) to toggle the camera state, or use [`startCamera`](../../api/mobile/functions/useCamera#startcamera) and [`stopCamera`](../../api/mobile/functions/useCamera#stopcamera) for more explicit control. + +#### Using toggleCamera + +```tsx +import { Button } from "react-native"; +import React from "react"; +import { useCamera } from "@fishjam-cloud/react-native-client"; + +export function ToggleCameraButton() { + const { isCameraOn, toggleCamera } = useCamera(); // [!code highlight] + + return ( + + + + ); +} +``` diff --git a/versioned_docs/version-0.25.0/how-to/client/metadata.mdx b/versioned_docs/version-0.25.0/how-to/client/metadata.mdx new file mode 100644 index 00000000..a80ae16f --- /dev/null +++ b/versioned_docs/version-0.25.0/how-to/client/metadata.mdx @@ -0,0 +1,211 @@ +--- +sidebar_position: 6 +title: "Metadata" +description: "How to use metadata" +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +Alongside audio and video, it is possible to send additional metadata with each peer. Metadata is just +JSON that can contain arbitrary information. Its most common use is sending a user name associated with a peer. +However, it can be also used to send the peer's camera type, application information etc. + +:::info + +You can also set metadata on [the server side, when adding user to the room](../backend/server-setup#metadata). This metadata is persistent throughout its lifetime and is useful for attaching information that +can't be overwritten by the peer, like information about real user names or basic permission info. + +::: + +## Setting metadata when joining the room + +The `joinRoom` method from the `useConnection` hook has a `peerMetadata` parameter, that can be used for setting object metadata. + + + + +```tsx +const PEER_TOKEN = "some-peer-token"; +// ---cut--- +import { useConnection } from "@fishjam-cloud/react-client"; +import React, { useCallback } from "react"; + +type PeerMetadata = { + displayName: string; +}; + +export function JoinRoomButton() { + const { joinRoom } = useConnection(); // [!code highlight] + + const onJoinRoomPress = useCallback(async () => { + await joinRoom({ + peerToken: PEER_TOKEN, + peerMetadata: { displayName: "John Wick" }, // [!code highlight] + }); + }, [joinRoom]); + + return ; +} +``` + + + + +```tsx +const PEER_TOKEN = "some-peer-token"; +// ---cut--- +import React, { useCallback } from "react"; +import { Button } from "react-native"; +import { useConnection } from "@fishjam-cloud/react-native-client"; + +type PeerMetadata = { + displayName: string; +}; + +export function JoinRoomButton() { + const { joinRoom } = useConnection(); + + const onPressJoin = useCallback(async () => { + // Note: fishjamId is passed to FishjamProvider, not joinRoom + await joinRoom({ + peerToken: PEER_TOKEN, + peerMetadata: { displayName: "John Wick" }, // [!code highlight] + }); + }, [joinRoom]); + + return ; +} +``` + + + + +```tsx +import React, { useCallback } from "react"; +import { Button } from "react-native"; +import { useUpdatePeerMetadata } from "@fishjam-cloud/react-native-client"; + +type PeerMetadata = { + displayName: string; +}; + +export function UpdateNameButton() { + const { updatePeerMetadata } = useUpdatePeerMetadata(); // [!code highlight] + + const onPressUpdateName = useCallback(async () => { + await updatePeerMetadata({ displayName: "Thomas A. Anderson" }); // [!code highlight] + }, [updatePeerMetadata]); + + return + + {cameraStream &&