@snf/qa-bot-core 0.2.32 → 0.2.33-rc.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.
@@ -106,6 +106,15 @@ export interface QABotProps {
106
106
  * Omit or pass empty string to disable Turnstile entirely on the frontend.
107
107
  */
108
108
  turnstileSiteKey?: string;
109
+ /**
110
+ * Backend identifier for proxy-based deployments.
111
+ * When using a Turnstile-validating proxy, set `qaEndpoint` to the proxy
112
+ * URL (e.g. "/api/chat") and `backendId` to the server-side backend
113
+ * identifier (e.g. "nairr"). The proxy resolves this ID to the actual
114
+ * backend URL from its ALLOWED_BACKENDS env var.
115
+ * When omitted, requests go directly to `qaEndpoint` (no proxy).
116
+ */
117
+ backendId?: string;
109
118
  /**
110
119
  * RP slug for resource-scoped queries (e.g. 'delta').
111
120
  * When set, included as resource_context in query POST body
@@ -1,5 +1,5 @@
1
1
  import QABot from './components/QABot';
2
- import type { QABotAnalyticsEvent } from './config';
2
+ import type { QABotProps } from './config';
3
3
  import './styles/index.css';
4
4
  export { QABot };
5
5
  export { FileUploadComponent } from './components/FileUploadComponent';
@@ -17,30 +17,14 @@ export type { QABotProps, BotControllerHandle, QABotAnalyticsEvent, QABotAnalyti
17
17
  * PROGRAMMATIC API TYPES
18
18
  * ===========================================
19
19
  */
20
- interface QABotConfig {
20
+ /**
21
+ * Config for the programmatic API (window.qaBotCore / qaBot()).
22
+ * Extends QABotProps with a target element and defaultOpen,
23
+ * and omits open/onOpenChange (managed internally).
24
+ */
25
+ interface QABotConfig extends Omit<QABotProps, 'open' | 'onOpenChange'> {
21
26
  target: HTMLElement;
22
- apiKey: string;
23
- qaEndpoint: string;
24
- ratingEndpoint?: string;
25
- capabilitiesEndpoint?: string;
26
- agentRatingEndpoint?: string;
27
27
  defaultOpen?: boolean;
28
- embedded?: boolean;
29
- isLoggedIn: boolean;
30
- allowAnonAccess?: boolean;
31
- turnstileSiteKey?: string;
32
- welcomeMessage: string;
33
- primaryColor?: string;
34
- secondaryColor?: string;
35
- botName?: string;
36
- logo?: string;
37
- placeholder?: string;
38
- errorMessage?: string;
39
- footerText?: string;
40
- footerLink?: string;
41
- tooltipText?: string;
42
- resourceContext?: string;
43
- onAnalyticsEvent?: (event: QABotAnalyticsEvent) => void;
44
28
  }
45
29
  interface QABotInstance {
46
30
  addMessage: (message: string) => void;
@@ -37,6 +37,8 @@ export interface CreateQAFlowParams {
37
37
  * applies, and the visible challenge is the fallback.
38
38
  */
39
39
  getTurnstileToken?: () => string | null;
40
+ /** Backend ID — included as _backend in request body for proxy routing. */
41
+ backendId?: string;
40
42
  /** RP slug for resource-scoped queries (e.g. 'delta'). */
41
43
  resourceContext?: string;
42
44
  }
@@ -44,7 +46,7 @@ export interface CreateQAFlowParams {
44
46
  * Creates the basic Q&A conversation flow
45
47
  * Handles questions, responses, and optional ratings
46
48
  */
47
- export declare const createQAFlow: ({ endpoint, ratingEndpoint, agentRatingEndpoint, apiKey, sessionId: getSessionId, isResetting, isLoggedIn, allowAnonAccess, loginUrl, actingUser, trackEvent, getTurnstileToken, resourceContext, }: CreateQAFlowParams) => {
49
+ export declare const createQAFlow: ({ endpoint, ratingEndpoint, agentRatingEndpoint, apiKey, sessionId: getSessionId, isResetting, isLoggedIn, allowAnonAccess, loginUrl, actingUser, trackEvent, getTurnstileToken, backendId, resourceContext, }: CreateQAFlowParams) => {
48
50
  qa_loop: {
49
51
  message: string;
50
52
  component: React.JSX.Element;
@@ -7,7 +7,7 @@
7
7
  * Usage for consumers:
8
8
  * localStorage.setItem('QA_BOT_DEBUG', 'true'); // Enable debug logs + version
9
9
  */
10
- export declare const LIB_VERSION = "0.2.32";
10
+ export declare const LIB_VERSION = "0.2.33-rc.1";
11
11
  export declare function isDebugEnabled(): boolean;
12
12
  export declare const logger: {
13
13
  version: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snf/qa-bot-core",
3
- "version": "0.2.32",
3
+ "version": "0.2.33-rc.1",
4
4
  "description": "A configurable chatbot setup for quick integration of RAG-powered Q&A and rating system",
5
5
  "main": "./dist/qa-bot-core.umd.cjs",
6
6
  "module": "./dist/qa-bot-core.js",