@useknest/widget-core 0.0.1-alpha.3 → 0.0.1-alpha.4

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/dist/config.d.ts CHANGED
@@ -1,3 +1,8 @@
1
1
  import { WidgetConfig } from './types';
2
- export declare function fetchWidgetConfig(publishableApiKey: string): Promise<WidgetConfig | null>;
2
+ /**
3
+ * Fetches widget configuration from the API.
4
+ * @param publishableApiKey - The API key for authentication
5
+ * @param baseUrl - Base URL for the API. Defaults to https://useknest.com. Pass empty string for relative paths.
6
+ */
7
+ export declare function fetchWidgetConfig(publishableApiKey: string, baseUrl?: string): Promise<WidgetConfig | null>;
3
8
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAsB,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAoB/F"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;GAIG;AACH,wBAAsB,iBAAiB,CACtC,iBAAiB,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAoB9B"}
@@ -1,6 +1,9 @@
1
- export declare const API_BASE_URL = "http://localhost:5173/api/v1";
2
- export declare const CHAT_API_URL = "http://localhost:5173/api/v1/chat-messages";
3
- export declare const CONFIG_API_URL = "http://localhost:5173/api/v1/widget-config";
1
+ export declare const DEFAULT_BASE_URL = "https://useknest.com";
2
+ export declare const API_PATH = "/api/v1";
3
+ /** Builds the chat messages API URL from a base URL. */
4
+ export declare function getChatApiUrl(baseUrl?: string): string;
5
+ /** Builds the widget config API URL from a base URL. */
6
+ export declare function getConfigApiUrl(baseUrl?: string): string;
4
7
  export declare const FALLBACK_ERROR_MESSAGE = "Sorry, I didn't get a response.";
5
8
  export declare const DEFAULT_ERROR_MESSAGE = "Unknown error occurred";
6
9
  export declare const DEFAULT_AVATAR_URL = "/default-avatar.svg";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iCAAiC,CAAC;AAC3D,eAAO,MAAM,YAAY,+CAAkC,CAAC;AAC5D,eAAO,MAAM,cAAc,+CAAkC,CAAC;AAE9D,eAAO,MAAM,sBAAsB,oCAAoC,CAAC;AACxE,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAC9D,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,uBAAuB,mHAC6E,CAAC;AAClH,eAAO,MAAM,yBAAyB,UAIrC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AACvD,eAAO,MAAM,QAAQ,YAAY,CAAC;AAElC,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,OAAO,GAAE,MAAyB,GAAG,MAAM,CAExE;AAED,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,OAAO,GAAE,MAAyB,GAAG,MAAM,CAE1E;AAED,eAAO,MAAM,sBAAsB,oCAAoC,CAAC;AACxE,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAC9D,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,uBAAuB,mHAC6E,CAAC;AAClH,eAAO,MAAM,yBAAyB,UAIrC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export type { MessageRole, Source, Message, ChatMessageRequest, ChatMessageResponse, ChatApiError, WidgetConfig, SSEEvent } from './types';
2
- export { API_BASE_URL, CHAT_API_URL, CONFIG_API_URL, FALLBACK_ERROR_MESSAGE, DEFAULT_ERROR_MESSAGE, DEFAULT_AVATAR_URL, DEFAULT_BRAND_COLOR, DEFAULT_WELCOME_MESSAGE, DEFAULT_EXAMPLE_QUESTIONS } from './constants';
2
+ export { DEFAULT_BASE_URL, API_PATH, getChatApiUrl, getConfigApiUrl, FALLBACK_ERROR_MESSAGE, DEFAULT_ERROR_MESSAGE, DEFAULT_AVATAR_URL, DEFAULT_BRAND_COLOR, DEFAULT_WELCOME_MESSAGE, DEFAULT_EXAMPLE_QUESTIONS } from './constants';
3
3
  export { fetchWidgetConfig } from './config';
4
4
  export { streamChatMessage } from './streaming';
5
5
  export type { StreamCallbacks, StreamMessageOptions } from './streaming';
6
6
  export { formatContent } from './utils';
7
+ export { initWidgetSentry, captureWidgetException } from './sentry';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACX,WAAW,EACX,MAAM,EACN,OAAO,EACP,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,MAAM,SAAS,CAAC;AAGjB,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EACzB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGzE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACX,WAAW,EACX,MAAM,EACN,OAAO,EACP,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,MAAM,SAAS,CAAC;AAGjB,OAAO,EACN,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EACzB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGzE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC"}