@convai/web-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +239 -0
- package/dist/components/RTCWidget.d.ts +56 -0
- package/dist/components/RTCWidget.d.ts.map +1 -0
- package/dist/components/RTCWidget.js +419 -0
- package/dist/components/RTCWidget.js.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/rtc-widget/components/AudioSettingsPanel.d.ts +10 -0
- package/dist/components/rtc-widget/components/AudioSettingsPanel.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/AudioSettingsPanel.js +316 -0
- package/dist/components/rtc-widget/components/AudioSettingsPanel.js.map +1 -0
- package/dist/components/rtc-widget/components/ConviMessage.d.ts +10 -0
- package/dist/components/rtc-widget/components/ConviMessage.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/ConviMessage.js +14 -0
- package/dist/components/rtc-widget/components/ConviMessage.js.map +1 -0
- package/dist/components/rtc-widget/components/FloatingVideo.d.ts +9 -0
- package/dist/components/rtc-widget/components/FloatingVideo.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/FloatingVideo.js +122 -0
- package/dist/components/rtc-widget/components/FloatingVideo.js.map +1 -0
- package/dist/components/rtc-widget/components/MarkdownRenderer.d.ts +7 -0
- package/dist/components/rtc-widget/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/MarkdownRenderer.js +68 -0
- package/dist/components/rtc-widget/components/MarkdownRenderer.js.map +1 -0
- package/dist/components/rtc-widget/components/MessageBubble.d.ts +10 -0
- package/dist/components/rtc-widget/components/MessageBubble.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/MessageBubble.js +23 -0
- package/dist/components/rtc-widget/components/MessageBubble.js.map +1 -0
- package/dist/components/rtc-widget/components/MessageList.d.ts +11 -0
- package/dist/components/rtc-widget/components/MessageList.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/MessageList.js +89 -0
- package/dist/components/rtc-widget/components/MessageList.js.map +1 -0
- package/dist/components/rtc-widget/components/UserMessage.d.ts +9 -0
- package/dist/components/rtc-widget/components/UserMessage.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/UserMessage.js +15 -0
- package/dist/components/rtc-widget/components/UserMessage.js.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviButton.d.ts +6 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviButton.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviButton.js +15 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviButton.js.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviFooter.d.ts +25 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviFooter.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviFooter.js +172 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviFooter.js.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviHeader.d.ts +17 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviHeader.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviHeader.js +66 -0
- package/dist/components/rtc-widget/components/conviComponents/ConviHeader.js.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/SettingsTray.d.ts +12 -0
- package/dist/components/rtc-widget/components/conviComponents/SettingsTray.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/SettingsTray.js +68 -0
- package/dist/components/rtc-widget/components/conviComponents/SettingsTray.js.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts +8 -0
- package/dist/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js +199 -0
- package/dist/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/index.d.ts +6 -0
- package/dist/components/rtc-widget/components/conviComponents/index.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/conviComponents/index.js +6 -0
- package/dist/components/rtc-widget/components/conviComponents/index.js.map +1 -0
- package/dist/components/rtc-widget/components/index.d.ts +9 -0
- package/dist/components/rtc-widget/components/index.d.ts.map +1 -0
- package/dist/components/rtc-widget/components/index.js +13 -0
- package/dist/components/rtc-widget/components/index.js.map +1 -0
- package/dist/components/rtc-widget/index.d.ts +6 -0
- package/dist/components/rtc-widget/index.d.ts.map +1 -0
- package/dist/components/rtc-widget/index.js +7 -0
- package/dist/components/rtc-widget/index.js.map +1 -0
- package/dist/components/rtc-widget/styles/framerConfig.d.ts +116 -0
- package/dist/components/rtc-widget/styles/framerConfig.d.ts.map +1 -0
- package/dist/components/rtc-widget/styles/framerConfig.js +73 -0
- package/dist/components/rtc-widget/styles/framerConfig.js.map +1 -0
- package/dist/components/rtc-widget/styles/icons.d.ts +28 -0
- package/dist/components/rtc-widget/styles/icons.d.ts.map +1 -0
- package/dist/components/rtc-widget/styles/icons.js +257 -0
- package/dist/components/rtc-widget/styles/icons.js.map +1 -0
- package/dist/components/rtc-widget/styles/index.d.ts +6 -0
- package/dist/components/rtc-widget/styles/index.d.ts.map +1 -0
- package/dist/components/rtc-widget/styles/index.js +9 -0
- package/dist/components/rtc-widget/styles/index.js.map +1 -0
- package/dist/components/rtc-widget/styles/styledComponents.d.ts +90 -0
- package/dist/components/rtc-widget/styles/styledComponents.d.ts.map +1 -0
- package/dist/components/rtc-widget/styles/styledComponents.js +640 -0
- package/dist/components/rtc-widget/styles/styledComponents.js.map +1 -0
- package/dist/components/rtc-widget/styles/theme.d.ts +188 -0
- package/dist/components/rtc-widget/styles/theme.d.ts.map +1 -0
- package/dist/components/rtc-widget/styles/theme.js +290 -0
- package/dist/components/rtc-widget/styles/theme.js.map +1 -0
- package/dist/components/rtc-widget/types/index.d.ts +60 -0
- package/dist/components/rtc-widget/types/index.d.ts.map +1 -0
- package/dist/components/rtc-widget/types/index.js +2 -0
- package/dist/components/rtc-widget/types/index.js.map +1 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +14 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useAudioControls.d.ts +41 -0
- package/dist/hooks/useAudioControls.d.ts.map +1 -0
- package/dist/hooks/useAudioControls.js +219 -0
- package/dist/hooks/useAudioControls.js.map +1 -0
- package/dist/hooks/useCharacterInfo.d.ts +17 -0
- package/dist/hooks/useCharacterInfo.d.ts.map +1 -0
- package/dist/hooks/useCharacterInfo.js +61 -0
- package/dist/hooks/useCharacterInfo.js.map +1 -0
- package/dist/hooks/useConvaiClient.d.ts +37 -0
- package/dist/hooks/useConvaiClient.d.ts.map +1 -0
- package/dist/hooks/useConvaiClient.js +348 -0
- package/dist/hooks/useConvaiClient.js.map +1 -0
- package/dist/hooks/useDynamicInfoUpdater.d.ts +33 -0
- package/dist/hooks/useDynamicInfoUpdater.d.ts.map +1 -0
- package/dist/hooks/useDynamicInfoUpdater.js +51 -0
- package/dist/hooks/useDynamicInfoUpdater.js.map +1 -0
- package/dist/hooks/useLocalCameraTrack.d.ts +22 -0
- package/dist/hooks/useLocalCameraTrack.d.ts.map +1 -0
- package/dist/hooks/useLocalCameraTrack.js +34 -0
- package/dist/hooks/useLocalCameraTrack.js.map +1 -0
- package/dist/hooks/useMessageHandler.d.ts +28 -0
- package/dist/hooks/useMessageHandler.d.ts.map +1 -0
- package/dist/hooks/useMessageHandler.js +317 -0
- package/dist/hooks/useMessageHandler.js.map +1 -0
- package/dist/hooks/useScreenShare.d.ts +45 -0
- package/dist/hooks/useScreenShare.d.ts.map +1 -0
- package/dist/hooks/useScreenShare.js +198 -0
- package/dist/hooks/useScreenShare.js.map +1 -0
- package/dist/hooks/useTemplateKeysUpdater.d.ts +35 -0
- package/dist/hooks/useTemplateKeysUpdater.d.ts.map +1 -0
- package/dist/hooks/useTemplateKeysUpdater.js +53 -0
- package/dist/hooks/useTemplateKeysUpdater.js.map +1 -0
- package/dist/hooks/useTriggerMessageSender.d.ts +28 -0
- package/dist/hooks/useTriggerMessageSender.d.ts.map +1 -0
- package/dist/hooks/useTriggerMessageSender.js +52 -0
- package/dist/hooks/useTriggerMessageSender.js.map +1 -0
- package/dist/hooks/useTtsToggle.d.ts +37 -0
- package/dist/hooks/useTtsToggle.d.ts.map +1 -0
- package/dist/hooks/useTtsToggle.js +65 -0
- package/dist/hooks/useTtsToggle.js.map +1 -0
- package/dist/hooks/useUserTextMessageSender.d.ts +28 -0
- package/dist/hooks/useUserTextMessageSender.d.ts.map +1 -0
- package/dist/hooks/useUserTextMessageSender.js +61 -0
- package/dist/hooks/useUserTextMessageSender.js.map +1 -0
- package/dist/hooks/useVideoControls.d.ts +39 -0
- package/dist/hooks/useVideoControls.d.ts.map +1 -0
- package/dist/hooks/useVideoControls.js +211 -0
- package/dist/hooks/useVideoControls.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +225 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/logger.d.ts +27 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +96 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +94 -0
package/README.md
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# @convai/web-sdk
|
|
2
|
+
|
|
3
|
+
The convai/web-sdk helps power characters in websites (brain) and the communication UI with Convai characters. This SDK facilitates the capture of user audio streams and provides appropriate responses in the form of audio, actions, and facial expressions.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @convai/web-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { useConvaiClient, RTCWidget } from "@convai/web-sdk";
|
|
15
|
+
|
|
16
|
+
function App() {
|
|
17
|
+
const convaiClient = useConvaiClient();
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<RTCWidget
|
|
21
|
+
convaiClient={convaiClient}
|
|
22
|
+
apiKey="your-convai-api-key"
|
|
23
|
+
characterId="your-character-id"
|
|
24
|
+
enableVideo={true}
|
|
25
|
+
startWithVideoOn={false}
|
|
26
|
+
enableAudio={true}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Get Convai Credentials
|
|
33
|
+
|
|
34
|
+
1. Visit [convai.com](https://convai.com) and create an account
|
|
35
|
+
2. Navigate to your dashboard
|
|
36
|
+
3. Create a new character or use an existing one
|
|
37
|
+
4. Copy your **API Key** from the dashboard
|
|
38
|
+
5. Copy your **Character ID** from the character details
|
|
39
|
+
|
|
40
|
+
## API Reference
|
|
41
|
+
|
|
42
|
+
### useConvaiClient()
|
|
43
|
+
|
|
44
|
+
Main hook for managing Convai connections.
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
const convaiClient = useConvaiClient();
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Returns:**
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
{
|
|
54
|
+
state: ConvaiClientState; // Connection and activity state
|
|
55
|
+
connect: (config) => Promise<void>; // Connect to Convai
|
|
56
|
+
disconnect: () => Promise<void>; // Disconnect from Convai
|
|
57
|
+
resetSession: () => void; // Reset the session ID
|
|
58
|
+
room: Room; // Internal room instance
|
|
59
|
+
sendUserTextMessage: (text) => void; // Send text message
|
|
60
|
+
sendTriggerMessage: (name?, msg?) => void; // Send trigger message
|
|
61
|
+
updateTemplateKeys: (keys) => void; // Update template keys
|
|
62
|
+
updateDynamicInfo: (info) => void; // Update dynamic info
|
|
63
|
+
chatMessages: ChatMessage[]; // Message history
|
|
64
|
+
audioControls: AudioControls; // Audio control methods
|
|
65
|
+
videoControls: VideoControls; // Video control methods
|
|
66
|
+
screenShareControls: ScreenShareControls; // Screen share controls
|
|
67
|
+
toggleTts: (enabled) => void; // Toggle text-to-speech
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**State Object:**
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
interface ConvaiClientState {
|
|
75
|
+
isConnected: boolean; // Connected to Convai
|
|
76
|
+
isConnecting: boolean; // Connection in progress
|
|
77
|
+
isListening: boolean; // Listening to user
|
|
78
|
+
isThinking: boolean; // Processing response
|
|
79
|
+
isSpeaking: boolean; // Speaking to user
|
|
80
|
+
agentState:
|
|
81
|
+
| "disconnected"
|
|
82
|
+
| "connected"
|
|
83
|
+
| "listening"
|
|
84
|
+
| "thinking"
|
|
85
|
+
| "speaking";
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Audio Controls:**
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
audioControls: {
|
|
93
|
+
isAudioMuted: boolean;
|
|
94
|
+
toggleAudio: () => Promise<void>;
|
|
95
|
+
muteAudio: () => Promise<void>;
|
|
96
|
+
unmuteAudio: () => Promise<void>;
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Video Controls:**
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
videoControls: {
|
|
104
|
+
isVideoEnabled: boolean;
|
|
105
|
+
enableVideo: () => Promise<void>;
|
|
106
|
+
disableVideo: () => Promise<void>;
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Screen Share Controls:**
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
screenShareControls: {
|
|
114
|
+
isScreenShareActive: boolean;
|
|
115
|
+
toggleScreenShare: () => Promise<void>;
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### RTCWidget Component
|
|
120
|
+
|
|
121
|
+
Complete all-in-one chat widget with automatic connection, voice mode, and video support.
|
|
122
|
+
|
|
123
|
+
**Features:**
|
|
124
|
+
|
|
125
|
+
- Collapsed circular button that expands on click
|
|
126
|
+
- Auto-connects on first interaction
|
|
127
|
+
- Text and voice mode support
|
|
128
|
+
- Video controls with floating video window
|
|
129
|
+
- Screen sharing capability
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
<RTCWidget
|
|
133
|
+
convaiClient={convaiClient}
|
|
134
|
+
apiKey="your-api-key"
|
|
135
|
+
characterId="your-character-id"
|
|
136
|
+
enableVideo={true}
|
|
137
|
+
startWithVideoOn={false}
|
|
138
|
+
enableAudio={true}
|
|
139
|
+
url="https://your-custom-url.com"
|
|
140
|
+
/>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Props:**
|
|
144
|
+
|
|
145
|
+
| Prop | Type | Required | Default | Description |
|
|
146
|
+
| ------------------ | -------------- | -------- | ------- | --------------------------------------------------- |
|
|
147
|
+
| `convaiClient` | `ConvaiClient` | Yes | - | ConvaiClient instance from useConvaiClient() |
|
|
148
|
+
| `apiKey` | `string` | Yes | - | Your Convai API key |
|
|
149
|
+
| `characterId` | `string` | No | - | Character ID to connect to |
|
|
150
|
+
| `enableVideo` | `boolean` | No | `false` | Enable video capability (shows video toggle button) |
|
|
151
|
+
| `startWithVideoOn` | `boolean` | No | `false` | Start with camera on when connecting |
|
|
152
|
+
| `enableAudio` | `boolean` | No | `true` | Enable audio |
|
|
153
|
+
| `url` | `string` | No | - | Custom Convai API URL |
|
|
154
|
+
|
|
155
|
+
## Configuration
|
|
156
|
+
|
|
157
|
+
**Config Interface:**
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
interface ConvaiConfig {
|
|
161
|
+
apiKey: string; // Required: Your Convai API key
|
|
162
|
+
characterId: string; // Required: Character ID
|
|
163
|
+
url?: string; // Optional: Custom API URL
|
|
164
|
+
enableVideo?: boolean; // Optional: Enable video (default: false)
|
|
165
|
+
enableAudio?: boolean; // Optional: Enable audio (default: true)
|
|
166
|
+
actionConfig?: ActionConfig; // Optional: Action configuration
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Advanced Usage
|
|
171
|
+
|
|
172
|
+
### Sending Messages
|
|
173
|
+
|
|
174
|
+
```tsx
|
|
175
|
+
// Send text message
|
|
176
|
+
convaiClient.sendUserTextMessage("Hello!");
|
|
177
|
+
|
|
178
|
+
// Send trigger message
|
|
179
|
+
convaiClient.sendTriggerMessage("greet", "Custom greeting");
|
|
180
|
+
|
|
181
|
+
// Update template keys
|
|
182
|
+
convaiClient.updateTemplateKeys({
|
|
183
|
+
user_name: "John",
|
|
184
|
+
location: "New York",
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// Update dynamic info
|
|
188
|
+
convaiClient.updateDynamicInfo({
|
|
189
|
+
text: "Additional context for the character",
|
|
190
|
+
});
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Control Audio/Video
|
|
194
|
+
|
|
195
|
+
```tsx
|
|
196
|
+
// Toggle microphone
|
|
197
|
+
await convaiClient.audioControls.toggleAudio();
|
|
198
|
+
|
|
199
|
+
// Mute/unmute
|
|
200
|
+
await convaiClient.audioControls.muteAudio();
|
|
201
|
+
await convaiClient.audioControls.unmuteAudio();
|
|
202
|
+
|
|
203
|
+
// Enable/disable video
|
|
204
|
+
await convaiClient.videoControls.enableVideo();
|
|
205
|
+
await convaiClient.videoControls.disableVideo();
|
|
206
|
+
|
|
207
|
+
// Toggle screen share
|
|
208
|
+
await convaiClient.screenShareControls.toggleScreenShare();
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Session Management
|
|
212
|
+
|
|
213
|
+
```tsx
|
|
214
|
+
// Reset session (clears history)
|
|
215
|
+
convaiClient.resetSession();
|
|
216
|
+
|
|
217
|
+
// Disconnect
|
|
218
|
+
await convaiClient.disconnect();
|
|
219
|
+
|
|
220
|
+
// Reconnect with new session
|
|
221
|
+
await convaiClient.connect(config);
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## TypeScript Support
|
|
225
|
+
|
|
226
|
+
The SDK is written in TypeScript and provides full type definitions. Import types as needed:
|
|
227
|
+
|
|
228
|
+
```tsx
|
|
229
|
+
import {
|
|
230
|
+
ConvaiClient,
|
|
231
|
+
ConvaiConfig,
|
|
232
|
+
ConvaiClientState,
|
|
233
|
+
ChatMessage,
|
|
234
|
+
} from "@convai/web-sdk";
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
MIT
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ConvaiClient } from "../types";
|
|
2
|
+
interface RTCWidgetProps {
|
|
3
|
+
convaiClient: ConvaiClient & {
|
|
4
|
+
activity?: string;
|
|
5
|
+
};
|
|
6
|
+
apiKey: string;
|
|
7
|
+
characterId?: string;
|
|
8
|
+
enableVideo?: boolean;
|
|
9
|
+
enableAudio?: boolean;
|
|
10
|
+
url?: string;
|
|
11
|
+
startWithVideoOn?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* RTCWidget - A consolidated chat widget component for real-time conversations
|
|
15
|
+
*
|
|
16
|
+
* This component combines all chat UI functionality into a single, easy-to-use widget
|
|
17
|
+
* with an expandable/collapsible interface similar to modern chat widgets.
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - Collapsed circular button with status indicator
|
|
21
|
+
* - Expandable/collapsible chat interface
|
|
22
|
+
* - Voice mode support
|
|
23
|
+
* - Real-time message streaming
|
|
24
|
+
* - Audio controls (mute/unmute)
|
|
25
|
+
* - Settings tray with session reset
|
|
26
|
+
* - Auto-connect on first click
|
|
27
|
+
*
|
|
28
|
+
* @param {RTCWidgetProps} props - Component props
|
|
29
|
+
* @param {ConvaiClient} props.convaiClient - Convai client instance
|
|
30
|
+
* @param {string} props.apiKey - Convai API key
|
|
31
|
+
* @param {string} props.characterId - Character ID to connect to
|
|
32
|
+
* @param {boolean} props.enableVideo - Enable video capability (default: false)
|
|
33
|
+
* @param {boolean} props.enableAudio - Enable audio (default: true)
|
|
34
|
+
* @param {boolean} props.startWithVideoOn - Start with video camera on when connecting (default: false)
|
|
35
|
+
* @param {string} props.url - Custom Convai URL
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* function App() {
|
|
40
|
+
* const convaiClient = useConvaiClient();
|
|
41
|
+
*
|
|
42
|
+
* return (
|
|
43
|
+
* <RTCWidget
|
|
44
|
+
* convaiClient={convaiClient}
|
|
45
|
+
* apiKey="your-api-key"
|
|
46
|
+
* characterId="360f1c86-c98a-11ef-82c5-42010a7be016"
|
|
47
|
+
* enableVideo={true}
|
|
48
|
+
* startWithVideoOn={false}
|
|
49
|
+
* />
|
|
50
|
+
* );
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare const RTCWidget: React.FC<RTCWidgetProps>;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=RTCWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RTCWidget.d.ts","sourceRoot":"","sources":["../../src/components/RTCWidget.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA4CxC,UAAU,cAAc;IACtB,YAAY,EAAE,YAAY,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAqoB9C,CAAC"}
|