diff --git a/vapi.ts b/vapi.ts index 4004ee4..594cd80 100644 --- a/vapi.ts +++ b/vapi.ts @@ -1,5 +1,6 @@ import { Call, CreateAssistantDTO, CreateSquadDTO, AssistantOverrides } from './api'; import DailyIframe, { + DailyAdvancedConfig, DailyCall, DailyEventObjectAppMessage, DailyEventObjectParticipant, @@ -108,11 +109,13 @@ export default class Vapi extends VapiEventEmitter { private started: boolean = false; private call: DailyCall | null = null; private speakingTimeout: NodeJS.Timeout | null = null; + private dailyCallConfig: DailyAdvancedConfig = {} - constructor(apiToken: string, apiBaseUrl?: string) { + constructor(apiToken: string, apiBaseUrl?: string, dailyCallConfig?: Pick) { super(); client.baseUrl = apiBaseUrl ?? 'https://api.vapi.ai'; client.setSecurityData(apiToken); + this.dailyCallConfig = dailyCallConfig ?? {} } private cleanup() { @@ -155,6 +158,7 @@ export default class Vapi extends VapiEventEmitter { this.call = DailyIframe.createCallObject({ audioSource: true, videoSource: isVideoRecordingEnabled, + dailyConfig: this.dailyCallConfig }); this.call.iframe()?.style.setProperty('display', 'none');