export interface XuqmInitOptions { appId: string serverUrl: string // e.g. "https://sentry.xuqinmin.com" — SDK fetches config from here appKey?: string debug?: boolean } export interface XuqmConfig { appId: string appKey: string serverUrl: string apiBaseUrl: string // im-service base URL imWsUrl: string // fetched from remote config fileServiceUrl: string // fetched from remote config debug: boolean } let _config: XuqmConfig | null = null export function initConfigFromRemote( options: XuqmInitOptions, remote: { imWsUrl: string; fileServiceUrl: string; apiBaseUrl: string }, ): void { _config = { appId: options.appId, appKey: options.appKey ?? options.appId, serverUrl: options.serverUrl, apiBaseUrl: remote.apiBaseUrl, imWsUrl: remote.imWsUrl, fileServiceUrl: remote.fileServiceUrl, debug: options.debug ?? false, } } export function getConfig(): XuqmConfig { if (!_config) throw new Error('[XuqmSDK] Not initialized — call XuqmSDK.initialize() first.') return _config } export function isInitialized(): boolean { return _config !== null }