Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fishjam-docs",
"version": "0.23.0",
"version": "0.24.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down
6 changes: 6 additions & 0 deletions versioned_docs/version-0.24.0/_common/agents/definition.mdx
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
:::
Original file line number Diff line number Diff line change
@@ -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.
12 changes: 12 additions & 0 deletions versioned_docs/version-0.24.0/api/_category_.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
31 changes: 31 additions & 0 deletions versioned_docs/version-0.24.0/api/mobile/functions/FishjamRoom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Function: FishjamRoom()

> **FishjamRoom**(`props`): `Element`

Defined in: [packages/react-native-client/src/components/FishjamRoom/index.tsx:39](https://github.com/fishjam-cloud/mobile-client-sdk/blob/efa62a8334bae1f0b89394bc9b884c47f9be9b37/packages/react-native-client/src/components/FishjamRoom/index.tsx#L39)

Simple component that enables your camera and show all tracks

Example usage:
```tsx
import { FishjamRoom } from '@fishjam-cloud/react-native-client';
import React from 'react';

const FISHJAM_ID = 'your-fishjam_id';
const PEER_TOKEN = 'your-peer-token';

<FishjamRoom
fishjamId={FISHJAM_ID}
peerToken={PEER_TOKEN}
/>
```

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `props` | [`FishjamRoomProps`](../type-aliases/FishjamRoomProps.md) | |

## Returns

`Element`
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Function: setOverwriteDebugConfig()

> **setOverwriteDebugConfig**(`partial`): `void`

Defined in: [packages/react-native-client/src/utils/config.ts:9](https://github.com/fishjam-cloud/mobile-client-sdk/blob/efa62a8334bae1f0b89394bc9b884c47f9be9b37/packages/react-native-client/src/utils/config.ts#L9)

## Parameters

| Parameter | Type |
| ------ | ------ |
| `partial` | `Partial`\<[`DebugConfig`](../type-aliases/DebugConfig.md)\> |

## Returns

`void`
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Function: useAudioSettings()

> **useAudioSettings**(): `object`

Defined in: [packages/react-native-client/src/hooks/useAudioSettings.ts:39](https://github.com/fishjam-cloud/mobile-client-sdk/blob/efa62a8334bae1f0b89394bc9b884c47f9be9b37/packages/react-native-client/src/hooks/useAudioSettings.ts#L39)

This hook manages audio settings.

## Returns

### availableDevices

> **availableDevices**: [`AudioOutputDevice`](../type-aliases/AudioOutputDevice.md)[]

[Android only] available audio output devices to be set

### selectAudioSessionMode()

> **selectAudioSessionMode**: (`audioSessionMode`) => `Promise`\<`void`\>

[iOS only] selects audio session mode. For more information refer to Apple's documentation:
https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `audioSessionMode` | [`AudioSessionMode`](../type-aliases/AudioSessionMode.md) |

#### Returns

`Promise`\<`void`\>

### selectedAudioOutputDevice

> **selectedAudioOutputDevice**: `null` \| [`AudioOutputDevice`](../type-aliases/AudioOutputDevice.md)

currently selected output audio device

### selectOutputAudioDevice()

> **selectOutputAudioDevice**: (`device`) => `Promise`\<`void`\>

[Android only] selects output audio device.
For detecting and selecting bluettoth devices make sure you have the BLUETOOTH_CONNECT permission.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `device` | [`AudioOutputDeviceType`](../type-aliases/AudioOutputDeviceType.md) |

#### Returns

`Promise`\<`void`\>

### showAudioRoutePicker()

> **showAudioRoutePicker**: () => `Promise`\<`void`\>

[iOS only] Shows a picker modal that allows user to select output audio device. For more
information refer to Apple's documentation: https://developer.apple.com/documentation/avkit/avroutepickerview

#### Returns

`Promise`\<`void`\>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Function: useBandwidthEstimation()

> **useBandwidthEstimation**(): `object`

Defined in: [packages/react-native-client/src/hooks/useBandwidthEstimation.ts:11](https://github.com/fishjam-cloud/mobile-client-sdk/blob/efa62a8334bae1f0b89394bc9b884c47f9be9b37/packages/react-native-client/src/hooks/useBandwidthEstimation.ts#L11)

This hook provides current bandwidth estimation
estimation - client's available incoming bitrate estimated
by the server. It's measured in bits per second.

## Returns

### estimation

> **estimation**: `null` \| `number`

Bandwidth estimation, measured in bits per second
90 changes: 90 additions & 0 deletions versioned_docs/version-0.24.0/api/mobile/functions/useCamera.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Function: useCamera()

> **useCamera**(): `object`

Defined in: [packages/react-native-client/src/hooks/useCamera.ts:116](https://github.com/fishjam-cloud/mobile-client-sdk/blob/efa62a8334bae1f0b89394bc9b884c47f9be9b37/packages/react-native-client/src/hooks/useCamera.ts#L116)

This hook can toggle camera on/off and provides current camera state.

## Returns

### cameras

> **cameras**: readonly [`Camera`](../type-aliases/Camera.md)[]

Property that lists cameras available on device.

#### Returns

A promise that resolves to the list of available cameras.

### currentCamera

> **currentCamera**: `null` \| [`Camera`](../type-aliases/Camera.md)

Which camera is now used for streaming (or will be used as default when camera will be enabled)

### isCameraOn

> **isCameraOn**: `boolean`

Informs if user camera is streaming video

### isInitialized

> **isInitialized**: `boolean` = `isCameraInitialized`

A value indicating if camera was already initialized (if `prepareCamera` was called).

### prepareCamera()

> **prepareCamera**: (`config`) => `Promise`\<`boolean`\>

Prepares camera and starts local video track

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `config` | `Readonly`\<[`CameraConfig`](../type-aliases/CameraConfig.md)\> | configuration of the camera capture |

#### Returns

`Promise`\<`boolean`\>

A promise that resolves when camera is started.

### simulcastConfig

> **simulcastConfig**: [`SimulcastConfig`](../type-aliases/SimulcastConfig.md)

Simulcast configuration

### switchCamera()

> **switchCamera**: (`cameraId`) => `Promise`\<`void`\>

Switches to the specified camera.
List of available devices can be retrieved from `cameras` variable

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `cameraId` | [`CameraId`](../type-aliases/CameraId.md) |

#### Returns

`Promise`\<`void`\>

A promise that resolves when camera is switched.

### toggleCamera()

> **toggleCamera**: () => `Promise`\<`void`\>

Enable/disable current camera

#### Returns

`Promise`\<`void`\>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Function: useConnection()

> **useConnection**(): `object`

Defined in: [packages/react-native-client/src/hooks/useConnection.ts:104](https://github.com/fishjam-cloud/mobile-client-sdk/blob/efa62a8334bae1f0b89394bc9b884c47f9be9b37/packages/react-native-client/src/hooks/useConnection.ts#L104)

Connect/leave room. And get connection status.

## Returns

### joinRoom()

> **joinRoom**: \<`PeerMetadata`\>(`__namedParameters`) => `Promise`\<`void`\>

Join room and start streaming camera and microphone

See [JoinRoomConfig](../type-aliases/JoinRoomConfig.md) for parameter list

#### Type Parameters

| Type Parameter | Default type |
| ------ | ------ |
| `PeerMetadata` *extends* [`GenericMetadata`](../type-aliases/GenericMetadata.md) | [`GenericMetadata`](../type-aliases/GenericMetadata.md) |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `__namedParameters` | [`JoinRoomConfig`](../type-aliases/JoinRoomConfig.md)\<`PeerMetadata`\> |

#### Returns

`Promise`\<`void`\>

### leaveRoom()

> **leaveRoom**: () => `void`

Leave room and stop streaming

#### Returns

`void`

### peerStatus

> **peerStatus**: [`PeerStatus`](../type-aliases/PeerStatus.md)

### reconnectionStatus

> **reconnectionStatus**: [`ReconnectionStatus`](../type-aliases/ReconnectionStatus.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Function: useMicrophone()

> **useMicrophone**(): `object`

Defined in: [packages/react-native-client/src/hooks/useMicrophone.ts:12](https://github.com/fishjam-cloud/mobile-client-sdk/blob/efa62a8334bae1f0b89394bc9b884c47f9be9b37/packages/react-native-client/src/hooks/useMicrophone.ts#L12)

This hook can toggle microphone on/off and provides current microphone state.

## Returns

### isMicrophoneOn

> **isMicrophoneOn**: `boolean`

Informs if microphone audio track is active

### startMicrophone()

> **startMicrophone**: () => `Promise`\<`void`\>

Starts microphone and requests permission if needed

#### Returns

`Promise`\<`void`\>

### stopMicrophone()

> **stopMicrophone**: () => `Promise`\<`void`\>

Stops microphone (mutes the track without removing it)

#### Returns

`Promise`\<`void`\>

### toggleMicrophone()

> **toggleMicrophone**: () => `Promise`\<`void`\>

Toggles microphone on/off based on the value of `isMicrophoneOn`

#### Returns

`Promise`\<`void`\>
39 changes: 39 additions & 0 deletions versioned_docs/version-0.24.0/api/mobile/functions/usePeers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Function: usePeers()

> **usePeers**\<`PeerMetadata`, `ServerMetadata`\>(): `object`

Defined in: [packages/react-native-client/src/hooks/usePeers.ts:186](https://github.com/fishjam-cloud/mobile-client-sdk/blob/efa62a8334bae1f0b89394bc9b884c47f9be9b37/packages/react-native-client/src/hooks/usePeers.ts#L186)

Hook that provides live updates of room peers.

## Type Parameters

| Type Parameter | Default type | Description |
| ------ | ------ | ------ |
| `PeerMetadata` *extends* [`GenericMetadata`](../type-aliases/GenericMetadata.md) | [`GenericMetadata`](../type-aliases/GenericMetadata.md) | Type for peer-specific metadata |
| `ServerMetadata` *extends* [`GenericMetadata`](../type-aliases/GenericMetadata.md) | [`GenericMetadata`](../type-aliases/GenericMetadata.md) | Type for server-specific metadata |

## 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**: [`Peer`](../type-aliases/Peer.md)\<`PeerMetadata`, `ServerMetadata`\>[]

#### Deprecated

Use localPeer and remotePeers instead
Legacy array containing all peers (both local and remote) without distinguished tracks.
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).
Loading