@convai/web-sdk 1.9.1 → 2.0.0-beta.0
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 +25 -14
- package/dist/core/ConvaiClient.js +10 -1
- package/dist/core/types.d.ts +13 -3
- package/dist/core/websocketUrl.d.ts +11 -0
- package/dist/core/websocketUrl.js +17 -0
- package/dist/react/hooks/index.d.ts +0 -2
- package/dist/react/hooks/index.js +0 -3
- package/dist/react/index.d.ts +0 -3
- package/dist/react/index.js +3 -10
- package/dist/utils/inlineMarkdown.d.ts +7 -5
- package/dist/utils/inlineMarkdown.js +7 -5
- package/dist/vanilla/WebSocketSession.d.ts +19 -13
- package/dist/vanilla/WebSocketSession.js +58 -14
- package/dist/vanilla/index.d.ts +6 -18
- package/dist/vanilla/index.js +7 -19
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +9 -8
- package/dist/react/components/ConvaiWidget.d.ts +0 -86
- package/dist/react/components/ConvaiWidget.js +0 -610
- package/dist/react/components/index.d.ts +0 -1
- package/dist/react/components/index.js +0 -2
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts +0 -9
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js +0 -315
- package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts +0 -35
- package/dist/react/components/rtc-widget/components/AudioVisualizer.js +0 -285
- package/dist/react/components/rtc-widget/components/ConviMessage.d.ts +0 -12
- package/dist/react/components/rtc-widget/components/ConviMessage.js +0 -13
- package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts +0 -8
- package/dist/react/components/rtc-widget/components/FloatingVideo.js +0 -120
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts +0 -31
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js +0 -140
- package/dist/react/components/rtc-widget/components/MessageBubble.d.ts +0 -9
- package/dist/react/components/rtc-widget/components/MessageBubble.js +0 -22
- package/dist/react/components/rtc-widget/components/MessageList.d.ts +0 -13
- package/dist/react/components/rtc-widget/components/MessageList.js +0 -88
- package/dist/react/components/rtc-widget/components/SiteCard.d.ts +0 -14
- package/dist/react/components/rtc-widget/components/SiteCard.js +0 -34
- package/dist/react/components/rtc-widget/components/UserMessage.d.ts +0 -8
- package/dist/react/components/rtc-widget/components/UserMessage.js +0 -14
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts +0 -5
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js +0 -14
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts +0 -24
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js +0 -170
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts +0 -16
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +0 -64
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts +0 -11
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +0 -65
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts +0 -13
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js +0 -298
- package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts +0 -5
- package/dist/react/components/rtc-widget/components/conviComponents/index.js +0 -5
- package/dist/react/components/rtc-widget/components/index.d.ts +0 -8
- package/dist/react/components/rtc-widget/components/index.js +0 -14
- package/dist/react/components/rtc-widget/index.d.ts +0 -5
- package/dist/react/components/rtc-widget/index.js +0 -8
- package/dist/react/components/rtc-widget/styles/framerConfig.d.ts +0 -115
- package/dist/react/components/rtc-widget/styles/framerConfig.js +0 -72
- package/dist/react/components/rtc-widget/styles/icons.d.ts +0 -27
- package/dist/react/components/rtc-widget/styles/icons.js +0 -256
- package/dist/react/components/rtc-widget/styles/index.d.ts +0 -5
- package/dist/react/components/rtc-widget/styles/index.js +0 -8
- package/dist/react/components/rtc-widget/styles/styledComponents.d.ts +0 -89
- package/dist/react/components/rtc-widget/styles/styledComponents.js +0 -662
- package/dist/react/components/rtc-widget/styles/theme.d.ts +0 -187
- package/dist/react/components/rtc-widget/styles/theme.js +0 -289
- package/dist/react/components/rtc-widget/types/index.d.ts +0 -59
- package/dist/react/components/rtc-widget/types/index.js +0 -1
- package/dist/react/hooks/useCharacterInfo.d.ts +0 -18
- package/dist/react/hooks/useCharacterInfo.js +0 -65
- package/dist/react/hooks/useLocalCameraTrack.d.ts +0 -21
- package/dist/react/hooks/useLocalCameraTrack.js +0 -33
- package/dist/react/icons.d.ts +0 -37
- package/dist/react/icons.js +0 -53
- package/dist/utils/lightbox.d.ts +0 -15
- package/dist/utils/lightbox.js +0 -94
- package/dist/vanilla/ConvaiWidget.d.ts +0 -46
- package/dist/vanilla/ConvaiWidget.js +0 -2866
- package/dist/vanilla/WidgetEventSubscriptions.d.ts +0 -14
- package/dist/vanilla/WidgetEventSubscriptions.js +0 -36
- package/dist/vanilla/icons.d.ts +0 -34
- package/dist/vanilla/icons.js +0 -268
- package/dist/vanilla/styles.d.ts +0 -168
- package/dist/vanilla/styles.js +0 -407
- package/dist/vanilla/types.d.ts +0 -170
- package/dist/vanilla/types.js +0 -1
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { LinkPreviewResolver } from "../../utils/linkPreview.js";
|
|
2
|
-
import type { IConvaiClient, PublishedChatConnectOptions } from "../../core/types.js";
|
|
3
|
-
import type { PublishedChatDescriptor } from "../../embed/publicationApi.js";
|
|
4
|
-
interface ConvaiWidgetProps {
|
|
5
|
-
/** Convai client instance (required) */
|
|
6
|
-
convaiClient: IConvaiClient & {
|
|
7
|
-
activity?: string;
|
|
8
|
-
isAudioMuted: boolean;
|
|
9
|
-
isVideoEnabled: boolean;
|
|
10
|
-
isScreenShareActive: boolean;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Show video toggle button in settings (default: true).
|
|
14
|
-
* Only works if connection type is "video". If false, hides the video button.
|
|
15
|
-
*/
|
|
16
|
-
showVideo?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Show screen share toggle button in settings (default: true).
|
|
19
|
-
* Only works if connection type is "video". If false, hides the screen share button.
|
|
20
|
-
*/
|
|
21
|
-
showScreenShare?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Start in voice mode by default when widget opens (default: true).
|
|
24
|
-
* When true, the widget will open directly in voice mode with microphone enabled.
|
|
25
|
-
*/
|
|
26
|
-
defaultVoiceMode?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Mint a fresh single-use grant when a published-chat session is reopened.
|
|
29
|
-
* Required when using this widget with connectWithPublicationGrant().
|
|
30
|
-
*/
|
|
31
|
-
requestPublicationGrant?: () => Promise<string>;
|
|
32
|
-
/** Core endpoint override used with requestPublicationGrant. */
|
|
33
|
-
publishedChatConnectOptions?: PublishedChatConnectOptions;
|
|
34
|
-
/**
|
|
35
|
-
* Open Graph lookup for plain web links the character sends. Supply a
|
|
36
|
-
* function that asks your backend for a page's metadata and each such link
|
|
37
|
-
* gets a site card (favicon, site name, title, description, image) once it
|
|
38
|
-
* resolves. Omit it and links render as before. See
|
|
39
|
-
* docs/convai_link_previews.md, "Site cards".
|
|
40
|
-
*/
|
|
41
|
-
linkPreviewResolver?: LinkPreviewResolver;
|
|
42
|
-
/** Public descriptor used to label a credential-free published session. */
|
|
43
|
-
publishedChatDescriptor?: Pick<PublishedChatDescriptor, "display_name" | "image_url">;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* ConvaiWidget - A consolidated chat widget component for real-time conversations
|
|
47
|
-
*
|
|
48
|
-
* This component provides a complete UI for interacting with Convai characters.
|
|
49
|
-
* Connection configuration should be handled via useConvaiClient.connect().
|
|
50
|
-
*
|
|
51
|
-
* Features:
|
|
52
|
-
* - Collapsed circular button with status indicator
|
|
53
|
-
* - Expandable/collapsible chat interface
|
|
54
|
-
* - Voice mode support
|
|
55
|
-
* - Real-time message streaming
|
|
56
|
-
* - Audio controls (mute/unmute)
|
|
57
|
-
* - Settings tray with session reset
|
|
58
|
-
* - Optional video and screen share (when connection type supports it)
|
|
59
|
-
*
|
|
60
|
-
* @param {ConvaiWidgetProps} props - Component props
|
|
61
|
-
* @param {ConvaiClient} props.convaiClient - Convai client instance (required)
|
|
62
|
-
* @param {boolean} props.showVideo - Show video toggle in settings (default: true)
|
|
63
|
-
* @param {boolean} props.showScreenShare - Show screen share toggle in settings (default: true)
|
|
64
|
-
* @param {boolean} props.defaultVoiceMode - Start in voice mode when widget opens (default: true)
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```tsx
|
|
68
|
-
* function App() {
|
|
69
|
-
* const convaiClient = useConvaiClient({
|
|
70
|
-
* apiKey: 'your-api-key',
|
|
71
|
-
* characterId: 'your-character-id',
|
|
72
|
-
* enableVideo: true,
|
|
73
|
-
* });
|
|
74
|
-
*
|
|
75
|
-
* return (
|
|
76
|
-
* <ConvaiWidget
|
|
77
|
-
* convaiClient={convaiClient}
|
|
78
|
-
* showVideo={true}
|
|
79
|
-
* showScreenShare={true}
|
|
80
|
-
* />
|
|
81
|
-
* );
|
|
82
|
-
* }
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
export declare const ConvaiWidget: React.FC<ConvaiWidgetProps>;
|
|
86
|
-
export {};
|