- Allow the chat-widget to connect to multiple servers (e.g. development and production)

- Created a full session overview
This commit is contained in:
Josako
2024-08-28 10:11:31 +02:00
parent 6062b7646c
commit bc350af247
14 changed files with 229 additions and 909 deletions

View File

@@ -1,13 +1,14 @@
// static/js/eveai-sdk.js
class EveAI {
constructor(tenantId, apiKey, domain, language, languages) {
constructor(tenantId, apiKey, domain, language, languages, serverUrl) {
this.tenantId = tenantId;
this.apiKey = apiKey;
this.domain = domain;
this.language = language;
this.languages = languages;
this.serverUrl = serverUrl;
console.log('EveAI constructor:', { tenantId, apiKey, domain, language, languages });
console.log('EveAI constructor:', { tenantId, apiKey, domain, language, languages, serverUrl });
}
initializeChat(containerId) {
@@ -21,6 +22,7 @@ class EveAI {
chatWidget.setAttribute('domain', this.domain);
chatWidget.setAttribute('language', this.language);
chatWidget.setAttribute('languages', this.languages);
chatWidget.setAttribute('server-url', this.serverUrl);
});
} else {
console.error('Container not found');