bettercx-widget
Version:
Professional AI-powered chat widget for BetterCX platform. Seamlessly integrate intelligent customer support into any website.
32 lines (31 loc) • 980 B
TypeScript
/**
* API Service
* Handles all API communication with backend services
*/
import { AuthService } from './auth.service';
import { OrganizationWidgetConfiguration } from '../types/api';
export declare class ApiService {
private authService;
private dbServiceUrl;
private aiServiceUrl;
constructor(dbServiceUrl?: string, aiServiceUrl?: string, authService?: AuthService);
/**
* Fetch widget configuration from backend
*/
getWidgetConfig(organizationId: number): Promise<OrganizationWidgetConfiguration>;
/**
* Send a chat message to the AI service
*/
sendMessage(message: string): Promise<ReadableStream<Uint8Array> | null>;
/**
* Parse streaming response from AI service
*/
parseStreamResponse(stream: ReadableStream<Uint8Array>): AsyncGenerator<{
type: string;
content: string;
}, void, unknown>;
/**
* Get the auth service instance
*/
getAuthService(): AuthService;
}