# koredotcom/web-kore-sdk architecture

> Architecture diagram of the GitHub repository koredotcom/web-kore-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/koredotcom/web-kore-sdk
- Repository: https://github.com/koredotcom/web-kore-sdk

## Overview

This repository is Kore.ai’s browser SDK for embedding bot conversations in web applications. The main workflow configures a chat widget, obtains a user assertion, connects to a bot over WebSocket, and presents messages and interactive templates. Separate branches provide the widget SDK, speech input/output, graph rendering, and agent-desktop features such as calling and co-browsing. The README documents the setup and chat flow; sampled source shows template callbacks and agent-desktop internals, but many integrations are not sampled, so those links are omitted or marked unverified.

Main entry points: [`UI/chatWindow.js`](https://github.com/koredotcom/web-kore-sdk/blob/master/UI/chatWindow.js) (Chat window), [`plugins/agentdestop/agentdesktop.js`](https://github.com/koredotcom/web-kore-sdk/blob/master/plugins/agentdestop/agentdesktop.js) (Agent desktop), [`UI/custom/customTemplate.js`](https://github.com/koredotcom/web-kore-sdk/blob/master/UI/custom/customTemplate.js) (Message templates), [`kore-bot-sdk-client.js`](https://github.com/koredotcom/web-kore-sdk/blob/master/kore-bot-sdk-client.js) (Bot SDK client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chat["Chat experience"]
  node_chatui["Chat window<br/>[chatWindow.js]"]
  node_templates["Message templates<br/>[customTemplate.js]"]
  node_widget["Widget SDK<br/>[kore-widgets.js]"]
end

subgraph group_identity["Identity and transport"]
  node_client["Bot SDK client"]
  node_assertion["JWT assertion"]
  node_platform(("Kore.ai bot platform"))
end

subgraph group_extensions["Conversation extensions"]
  node_graph["Graph adapter"]
  node_carousel["Carousel support<br/>[purejscarousel.js]"]
  node_emoji["Emoji support<br/>[emoji.js]"]
end

subgraph group_speech["Speech services"]
  node_recorder["Audio recorder<br/>[recorder.js]"]
  node_recorderworker["Audio processing<br/>[recorderWorker.js]"]
  node_googletranscribe["Google transcription<br/>[app.js]"]
  node_clientapi["Google speech client<br/>[client_api.js]"]
  node_azurespeech["Azure speech"]
  node_azuretts["Azure text-to-speech<br/>[kore-azure-tts.js]"]
  node_polly["AWS Polly<br/>[kore-aws-polly.js]"]
end

subgraph group_agent["Agent desktop"]
  node_agentdesktop["Agent desktop<br/>[agentdesktop.js]"]
  node_audio["Call audio player<br/>[audio_player.js]"]
  node_clickcall["Click-to-call<br/>[c2c.js]"]
end

node_developer(("Integrating app"))

node_developer -->|"configures and opens"| node_chatui
node_chatui -->|"requests assertion"| node_assertion
node_chatui -->|"initializes SDK"| node_client
node_client -->|"connects by WebSocket"| node_platform
node_chatui -.->|"renders templates"| node_templates
node_templates -->|"sends user actions"| node_chatui
node_chatui -.->|"opens separately"| node_widget
node_chatui -->|"renders graphs"| node_graph
node_chatui -->|"renders carousels"| node_carousel
node_chatui -->|"supports emoji"| node_emoji
node_chatui -->|"records audio"| node_recorder
node_recorder -.->|"processes audio"| node_recorderworker
node_chatui -->|"transcribes speech"| node_googletranscribe
node_googletranscribe -->|"uses speech API"| node_clientapi
node_chatui -.->|"optional speech"| node_azurespeech
node_chatui -.->|"optional speech output"| node_azuretts
node_chatui -.->|"optional speech output"| node_polly
node_developer -.->|"integrates agent features"| node_agentdesktop
node_agentdesktop -.->|"uses call audio"| node_audio
node_agentdesktop -.->|"supports click-to-call"| node_clickcall

click node_chatui "https://github.com/koredotcom/web-kore-sdk/blob/master/UI/chatWindow.js"
click node_templates "https://github.com/koredotcom/web-kore-sdk/blob/master/UI/custom/customTemplate.js"
click node_widget "https://github.com/koredotcom/web-kore-sdk/blob/master/UI/kore-widgets.js"
click node_client "https://github.com/koredotcom/web-kore-sdk/blob/master/kore-bot-sdk-client.js"
click node_assertion "https://github.com/koredotcom/web-kore-sdk/blob/master/libs/anonymousassertion.js"
click node_graph "https://github.com/koredotcom/web-kore-sdk/blob/master/libs/KoreGraphAdapter.js"
click node_carousel "https://github.com/koredotcom/web-kore-sdk/blob/master/libs/purejscarousel.js"
click node_emoji "https://github.com/koredotcom/web-kore-sdk/blob/master/libs/emoji.js"
click node_recorder "https://github.com/koredotcom/web-kore-sdk/blob/master/libs/recorder.js"
click node_recorderworker "https://github.com/koredotcom/web-kore-sdk/blob/master/libs/recorderWorker.js"
click node_googletranscribe "https://github.com/koredotcom/web-kore-sdk/blob/master/libs/speech/app.js"
click node_clientapi "https://github.com/koredotcom/web-kore-sdk/blob/master/libs/client_api.js"
click node_azurespeech "https://github.com/koredotcom/web-kore-sdk/blob/master/libs/speech/azure/kore-azure-speech.js"
click node_azuretts "https://github.com/koredotcom/web-kore-sdk/blob/master/libs/speech/azure/kore-azure-tts.js"
click node_polly "https://github.com/koredotcom/web-kore-sdk/blob/master/plugins/kore-aws-polly.js"
click node_agentdesktop "https://github.com/koredotcom/web-kore-sdk/blob/master/plugins/agentdestop/agentdesktop.js"
click node_audio "https://github.com/koredotcom/web-kore-sdk/blob/master/plugins/agentdestop/libs/audio_player.js"
click node_clickcall "https://github.com/koredotcom/web-kore-sdk/blob/master/plugins/agentdestop/libs/c2c.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chatui,node_templates,node_widget toneBlue
class node_client,node_assertion,node_platform toneAmber
class node_graph,node_carousel,node_emoji toneMint
class node_recorder,node_recorderworker,node_googletranscribe,node_clientapi,node_azurespeech,node_azuretts,node_polly toneRose
class node_agentdesktop,node_audio,node_clickcall,node_developer toneIndigo
```

## Components

### Chat experience

- [Chat window](https://github.com/koredotcom/web-kore-sdk/blob/master/UI/chatWindow.js): `UI/chatWindow.js`
- [Message templates](https://github.com/koredotcom/web-kore-sdk/blob/master/UI/custom/customTemplate.js): `UI/custom/customTemplate.js`
- [Widget SDK](https://github.com/koredotcom/web-kore-sdk/blob/master/UI/kore-widgets.js): `UI/kore-widgets.js`

### Identity and transport

- [Bot SDK client](https://github.com/koredotcom/web-kore-sdk/blob/master/kore-bot-sdk-client.js): `kore-bot-sdk-client.js`
- [JWT assertion](https://github.com/koredotcom/web-kore-sdk/blob/master/libs/anonymousassertion.js): `libs/anonymousassertion.js`
- **Kore.ai bot platform**

### Conversation extensions

- [Graph adapter](https://github.com/koredotcom/web-kore-sdk/blob/master/libs/KoreGraphAdapter.js): `libs/KoreGraphAdapter.js`
- [Carousel support](https://github.com/koredotcom/web-kore-sdk/blob/master/libs/purejscarousel.js): `libs/purejscarousel.js`
- [Emoji support](https://github.com/koredotcom/web-kore-sdk/blob/master/libs/emoji.js): `libs/emoji.js`

### Speech services

- [Audio recorder](https://github.com/koredotcom/web-kore-sdk/blob/master/libs/recorder.js): `libs/recorder.js`
- [Audio processing](https://github.com/koredotcom/web-kore-sdk/blob/master/libs/recorderWorker.js): `libs/recorderWorker.js`
- [Google transcription](https://github.com/koredotcom/web-kore-sdk/blob/master/libs/speech/app.js): `libs/speech/app.js`
- [Google speech client](https://github.com/koredotcom/web-kore-sdk/blob/master/libs/client_api.js): `libs/client_api.js`
- [Azure speech](https://github.com/koredotcom/web-kore-sdk/blob/master/libs/speech/azure/kore-azure-speech.js): `libs/speech/azure/kore-azure-speech.js`
- [Azure text-to-speech](https://github.com/koredotcom/web-kore-sdk/blob/master/libs/speech/azure/kore-azure-tts.js): `libs/speech/azure/kore-azure-tts.js`
- [AWS Polly](https://github.com/koredotcom/web-kore-sdk/blob/master/plugins/kore-aws-polly.js): `plugins/kore-aws-polly.js`

### Agent desktop

- [Agent desktop](https://github.com/koredotcom/web-kore-sdk/blob/master/plugins/agentdestop/agentdesktop.js): `plugins/agentdestop/agentdesktop.js`
- [Call audio player](https://github.com/koredotcom/web-kore-sdk/blob/master/plugins/agentdestop/libs/audio_player.js): `plugins/agentdestop/libs/audio_player.js`
- [Click-to-call](https://github.com/koredotcom/web-kore-sdk/blob/master/plugins/agentdestop/libs/c2c.js): `plugins/agentdestop/libs/c2c.js`

### Other components

- **Integrating app**

## Connections

- Integrating app → Chat window: configures and opens
- Chat window → JWT assertion: requests assertion
- Chat window → Bot SDK client: initializes SDK
- Bot SDK client → Kore.ai bot platform: connects by WebSocket
- Chat window → Message templates: renders templates
- Message templates → Chat window: sends user actions (evidence: `UI/custom/customTemplate.js`)
- Chat window → Widget SDK: opens separately
- Chat window → Graph adapter: renders graphs
- Chat window → Carousel support: renders carousels
- Chat window → Emoji support: supports emoji
- Chat window → Audio recorder: records audio
- Audio recorder → Audio processing: processes audio
- Chat window → Google transcription: transcribes speech (evidence: `libs/speech/app.js`)
- Google transcription → Google speech client: uses speech API (evidence: `libs/speech/app.js`)
- Chat window → Azure speech: optional speech
- Chat window → Azure text-to-speech: optional speech output
- Chat window → AWS Polly: optional speech output
- Integrating app → Agent desktop: integrates agent features
- Agent desktop → Call audio player: uses call audio
- Agent desktop → Click-to-call: supports click-to-call
