Skip to main content

Connectors — Overview

A connector is the adapter between Chativa and your backend. It implements IConnector.

If "connector" is a new word, read Concepts → Ports first — the whole port idea is what makes Chativa transport-agnostic.

Built-in connectors

PackageClassBest for
@chativa/connector-dummyDummyConnectorDevelopment, tests, sandbox demos. Pure local mock.
@chativa/connector-websocketWebSocketConnectorCustom WS backend. JSON frames in/out.
@chativa/connector-signalrSignalRConnectorMicrosoft SignalR hub.
@chativa/connector-directlineDirectLineConnectorAzure Bot Framework v3. Maps every activity type.
@chativa/connector-sseSseConnectorServer-Sent Events stream + REST POST.
@chativa/connector-httpHttpConnectorPlain REST polling — simplest deployment.
Customyour classAnything else (REST, MQTT, gRPC, IPC…).

Registering and selecting a connector

import { ConnectorRegistry, chatStore } from "@chativa/core";
import { DirectLineConnector } from "@chativa/connector-directline";

ConnectorRegistry.register(new DirectLineConnector({ token: "..." }));
chatStore.getState().setConnector("directline");

Or via <chat-iva connector="directline"> once it's registered.

Capability matrix

All optional methods are feature-detected at runtime. A capability is "advertised" simply by implementing the method.

CapabilityMethodDummyWSSignalRDirectLineSSEHTTP
Send messagesendMessage
ReceiveonMessage
Connect / disconnect eventsonConnect / onDisconnect
Typing indicatoronTyping
File uploadsendFile
History paginationloadHistory
Delivery / read statusonMessageStatus
Like / dislike feedbacksendFeedback
End-of-conversation surveysendSurvey
GenUI streamingonGenUIChunk
Multi-conversationlistConversations & co

Empty cells are connectors that simply don't implement the method — the corresponding UI feature degrades gracefully (e.g. the file upload button hides itself when sendFile is missing).

Configuration

Each connector's options have a JSON Schema under schemas/connectors/ — drop the $schema URL into a config file and your editor will validate it as you type.