chataptor 0.2.0
chataptor: ^0.2.0 copied to clipboard
Headless Dart client for Chataptor — real-time, auto-translated customer support chat in 100+ languages. Free forever. Pair with chataptor_flutter for drop-in widgets.
Changelog #
All notable changes to this package will be documented in this file. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.0 - 2026-05-22 #
Added #
ChataptorClient.identify()— migrates the active session to a newCustomerIdentity(e.g., after the customer signs in). Reconnects when the client is currentlyConnectedso the next channel join carries the updated identity. ThrowsChataptorStateErrorwhen invoked duringConnecting/Reconnecting— call only when the connection is stable.FakeChataptorClient.identify()stub +recorded.identifyCallsfor asserting that a host-app sign-in flow invoked identify.ChataptorConfig.sessionIdleTimeout— when set, the SDK persistslast_activity_aton every send / receive and clears the stored guest session at the start of the nextconnect()if the gap exceeds the timeout. Idle expiry takes precedence overidentify()'s continuity guarantee.SiteConfig.nextAvailable— best-effort UTC timestamp parsed from the backend'ssite_configpayload indicating when an agent is next expected to be available. Alwaysnullwhen the backend has not computed or chosen to expose this value.clearSession()now also removes the persistedlast_activity_atstamp so the nextconnect()starts on a clean slate.
Changed #
guestIdis now always sent on socket connect — even for identified customers — so conversation continuity is preserved when a customer migrates from anonymous to identified mid-session viaidentify().- Identified customer attributes are now packed into a single
customerDatamap on socket connect ({email, name, hash?, ...customData}) instead of separate top-levelcustomerEmail/customerNamekeys. connect()now sendscustomerName/customerEmailin theconversation:createpayload when the customer is identified, so the conversation gets the right attribution from the first message.ChataptorClient.internaland the default constructor now share a single in-memory storage instance between the client's own state and the internalGuestIdStorewhen no storage adapter is provided. Previously two separateInMemoryChataptorStorageinstances were silently created.
0.1.0 - 2026-05-19 #
Added #
ChataptorClientwith anonymous customer identification, connect/disconnect lifecycle, andsendMessageover Phoenix Channels.ChatTransportport abstraction withPhoenixSocketTransportreference implementation andFakeChatTransporttest double.- Sealed Dart 3 types:
ConnectionState,ChataptorError,SendResult. - Immutable domain models:
Message,Conversation,AgentInfo,Attachment,CustomerIdentity,MessageDraft. - Configuration tree:
ChataptorConfig,TransportClientConfig,TranslationConfig,FeatureToggles,AttachmentConfig,PushConfig,ChataptorHooks. - Adapter ports with in-memory defaults:
ChataptorStorage,ChataptorHttpClient,ChataptorLogger. - Testing sub-library (
package:chataptor/testing.dart) withFakeChataptorClient,FakeChatTransport,InMemoryChataptorStorage,RecordingChataptorLogger. SiteConfigmodel parsed from thesite:Xchannel join payload (welcome message, header title per active language, offline mode, language variants).AgentInfomodel (withAgentInitials) + subscriptions to backendagent:available/agents:offlineevents; exposed viaChataptorClient.currentOnlineAgentsandonlineAgentsStream.- Client-side injection of the configured
welcome_messageas the first agentMessagewhen conversation history is empty (mirrors the web widget behaviour). Skipped on reconnect with non-empty history to avoid duplication.