Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@videosdk.live/react-sdk

Package Overview
Dependencies
Maintainers
0
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@videosdk.live/react-sdk - npm Package Compare versions

Comparing version 0.1.94 to 0.1.95

dist/types/character.d.ts

156

dist/types/index.d.ts

@@ -19,2 +19,3 @@ // Type definitions for @videosdk.live/react-sdk 0.1

import { Stream } from './stream';
import { Character, CharacterMode, CharacterState } from './character';
/**

@@ -89,3 +90,3 @@ * @param children - Render child component.

autoConsume?: boolean;
preferredProtocol?: "UDP_ONLY" | "UDP_OVER_TCP" | "TCP_ONLY";
preferredProtocol?: 'UDP_ONLY' | 'UDP_OVER_TCP' | 'TCP_ONLY';
participantId?: string | undefined;

@@ -645,3 +646,5 @@ name: string;

onMeetingStateChanged,
onParticipantModeChanged
onParticipantModeChanged,
onCharacterJoined,
onCharacterLeft
}?: {

@@ -771,2 +774,4 @@ onParticipantJoined?: (participant: Participant) => void;

}) => void;
onCharacterJoined?: (character: Character) => void;
onCharacterLeft?: (character: Character) => void;
}): {

@@ -778,2 +783,3 @@ meetingId: string;

participants: Map<string, Participant>;
characters: Map<string, Character>;
pinnedParticipants: Map<

@@ -1014,3 +1020,3 @@ string,

*
* const { startTranscription, stopTranscription } = useTranscription(topic, {
* const { startTranscription, stopTranscription } = useTranscription({
* onTranscriptionStateChanged,

@@ -1065,2 +1071,144 @@ * onTranscriptionText,

/**
* @param onCharacterStateChanged - This will triggered when a character state is changed.
* ---
* @param onCharacterMessage - This will triggered when a character response/message is published.
* ---
* @param onStreamEnabled - It's a callback which gets triggered whenever a character's video, audio or screen share stream is enabled.
* ---
* @param onStreamEnabled - It's a callback which gets triggered whenever a character's video, audio or screen share stream is disabled.
* ---
* @param onMediaStatusChanged - It's a callback which gets triggered whenever a character's video or audio is disabled or enabled.
* ---
* @param onVideoQualityChanged -
* - It's a callback which gets triggered whenever a character's video quality changes.
* - currentQuality and prevQuality can have values `HIGH` | `MEDIUM` | `LOW`.
* ---
* @returns This will return `character` Object.
* ---
* **useCharacter example**
* ```js
*
* function onCharacterStateChanged(data) {
* console.log('New State Payload:', data)
* }
*
* function onCharacterMessage(data) {
* console.log('character message Payload:', data);
* }
*
* const { join, leave, sendMessage } = useCharacter({
* interactionId,
* // OR
* id,
* displayName,
* characterRole,
* characterMode,
* knowledgeBases,
* },
* {
* onCharacterStateChanged,
* onCharacterMessage,
* onCharacterJoined,
* onCharacterLeft,
*
* onStreamEnabled,
* onStreamDisabled,
* onMediaStatusChanged,
* onVideoQualityChanged
* });
*
* async function joinCharacter()=>{
* await join()
* }
*
* async function removeCharacter()=>{
* await leave()
* }
* ```
*/
export function useCharacter(
{
interactionId,
// OR
id,
displayName,
characterRole,
characterMode,
knowledgeBases
}: {
interactionId: string;
// OR
id: string;
displayName: string;
characterRole: string;
characterMode: 'text2text' | 'speech2text' | 'speech2speech';
knowledgeBases: string[];
},
{
onCharacterStateChanged,
onCharacterMessage,
onStreamEnabled,
onStreamDisabled,
onMediaStatusChanged,
onVideoQualityChanged
}: {
onCharacterStateChanged?: (data: {
id: string;
status: CharacterState;
}) => void;
onCharacterMessage?: (data: {
participantId: string;
participantName: string;
text: string;
timestamp: number;
}) => void;
onCharacterJoined?: () => void;
onCharacterLeft?: () => void;
onStreamDisabled?: (stream: Stream) => void;
onStreamEnabled?: (stream: Stream) => void;
onMediaStatusChanged?: ({
kind,
peerId,
newStatus
}: {
kind: 'audio' | 'video';
peerId: string;
newStatus: boolean;
}) => void;
onVideoQualityChanged?: ({
peerId,
prevQuality,
currentQuality
}: {
peerId: string;
prevQuality: 'low' | 'med' | 'high';
currentQuality: 'low' | 'med' | 'high';
}) => void;
}
): {
displayName: string;
webcamStream: Stream;
micStream: Stream;
webcamOn: boolean;
micOn: boolean;
isActiveSpeaker: boolean;
interactionId?: string;
id?: string;
characterMode?: CharacterMode;
characterState?: CharacterState;
knowledgeBases?: string[];
enableMic: () => void;
disableMic: () => void;
enableWebcam: () => void;
disableWebcam: () => void;
join: () => Promise<void>;
leave: () => Promise<void>;
sendMessage: (text: string) => Promise<void>;
};
/**
* @param microphoneId - It will be the id of the mic from which the audio should be captured.

@@ -1328,2 +1476,4 @@ * ---

};
characterState: CharacterState;
characterMode: CharacterMode;
modes: {

@@ -1330,0 +1480,0 @@ CONFERENCE: string;

@@ -466,3 +466,7 @@ export class Meeting {

| 'error'
| 'chat-message',
| 'chat-message'
| 'transcription-text'
| 'transcription-state-changed'
| 'character-joined'
| 'character-left',
listener: (data: any) => void

@@ -510,3 +514,8 @@ ): void;

| 'error'
| 'chat-message',
| 'chat-message'
| 'transcription-text'
| 'transcription-state-changed'
| 'character-joined'
| 'character-left',
listener: (data: any) => void

@@ -513,0 +522,0 @@ ): void;

4

package.json
{
"name": "@videosdk.live/react-sdk",
"version": "0.1.94",
"version": "0.1.95",
"license": "ISC",

@@ -76,5 +76,5 @@ "main": "dist/index.js",

"dependencies": {
"@videosdk.live/js-sdk": "0.0.90",
"@videosdk.live/js-sdk": "0.0.91",
"events": "^3.3.0"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc