@bnagaraju7/chat-widget 0.1.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.
@@ -0,0 +1,35 @@
1
+ import * as react from 'react';
2
+
3
+ interface GarudaChatUser {
4
+ id: string;
5
+ fullname?: string;
6
+ email?: string;
7
+ }
8
+ interface GarudaChatConfig {
9
+ /** Base URL of the support/chat REST API, e.g. "https://api.example.com" */
10
+ apiBaseUrl: string;
11
+ /** Sent as the `organisation_id` header on every REST request, if provided */
12
+ organisationId?: string;
13
+ /** Phone number shown/dialled for the voice-call fallback. Omit to hide the call button. */
14
+ supportPhone?: string;
15
+ /** Identifies the visitor for chat context and rating submission. Omit for guest/anonymous chats. */
16
+ user?: GarudaChatUser;
17
+ /** Bearer token sent on REST requests. Omit to use guest (unauthenticated) mode. */
18
+ authToken?: string;
19
+ /** Called when the user clicks a "read article" knowledge-base result. Defaults to a no-op. */
20
+ onNavigateToKnowledgeBase?: () => void;
21
+ /** Called on a 401 response to an authenticated request. Defaults to a no-op (no redirect). */
22
+ onUnauthorized?: () => void;
23
+ }
24
+
25
+ /**
26
+ * Public entry point: the AI chatbot + browser voice support (speech-to-text
27
+ * input, Twilio voice call + OTP), talking only to `apiBaseUrl` over REST.
28
+ * No Supabase, no session history, no human-agent handoff — those depended
29
+ * on direct browser-to-Supabase access this package doesn't have.
30
+ */
31
+ declare function GarudaChatWidget({ config }: {
32
+ config: GarudaChatConfig;
33
+ }): react.JSX.Element;
34
+
35
+ export { type GarudaChatConfig, type GarudaChatUser, GarudaChatWidget };
@@ -0,0 +1,35 @@
1
+ import * as react from 'react';
2
+
3
+ interface GarudaChatUser {
4
+ id: string;
5
+ fullname?: string;
6
+ email?: string;
7
+ }
8
+ interface GarudaChatConfig {
9
+ /** Base URL of the support/chat REST API, e.g. "https://api.example.com" */
10
+ apiBaseUrl: string;
11
+ /** Sent as the `organisation_id` header on every REST request, if provided */
12
+ organisationId?: string;
13
+ /** Phone number shown/dialled for the voice-call fallback. Omit to hide the call button. */
14
+ supportPhone?: string;
15
+ /** Identifies the visitor for chat context and rating submission. Omit for guest/anonymous chats. */
16
+ user?: GarudaChatUser;
17
+ /** Bearer token sent on REST requests. Omit to use guest (unauthenticated) mode. */
18
+ authToken?: string;
19
+ /** Called when the user clicks a "read article" knowledge-base result. Defaults to a no-op. */
20
+ onNavigateToKnowledgeBase?: () => void;
21
+ /** Called on a 401 response to an authenticated request. Defaults to a no-op (no redirect). */
22
+ onUnauthorized?: () => void;
23
+ }
24
+
25
+ /**
26
+ * Public entry point: the AI chatbot + browser voice support (speech-to-text
27
+ * input, Twilio voice call + OTP), talking only to `apiBaseUrl` over REST.
28
+ * No Supabase, no session history, no human-agent handoff — those depended
29
+ * on direct browser-to-Supabase access this package doesn't have.
30
+ */
31
+ declare function GarudaChatWidget({ config }: {
32
+ config: GarudaChatConfig;
33
+ }): react.JSX.Element;
34
+
35
+ export { type GarudaChatConfig, type GarudaChatUser, GarudaChatWidget };