chatasist_flutter 1.6.2
chatasist_flutter: ^1.6.2 copied to clipboard
Flutter plugin for embedding the Chatasist customer support chat widget with realtime messaging, media uploads, and voice/video call support.
1.6.2 #
- Catch up after a connection drop. Realtime events sent while the socket was down are not replayed, so the plugin now reloads the chat list and the open conversation when the socket reconnects and when the app returns to the foreground. Replies and status changes (for example a chat being closed) that arrived in the meantime now show up without reopening the chat.
chatasistFlutter.setLanguage(...). Switch the widget language at runtime (az,en,ru,tr; regional forms such asaz-AZare accepted). The session is reloaded so the UI, dates, welcome texts, news, help topics and AI replies follow it; the realtime connection is kept.- Re-initializing no longer leaks a connection. Calling
initialize()again now closes the previous instance first — its realtime socket, listeners and any open widget. - Read state follows the customer. The unread badge now uses the backend's per-chat
customer_last_read_message_id, and opening a chat reports it withPOST /api/widget/chats/{id}/read. Signing in or switching devices no longer shows old conversations as unread. Against an older backend without that field, the plugin falls back to device storage, now kept separately per customer.
1.6.1 #
- Live chat status. The plugin now handles the
.chat.updatedrealtime event on the customer channel and appliesstatus,assignee_id,is_chat_with_ai,nameandavatarto the open conversation and the chat list immediately. When an operator resolves a chat, or it is closed automatically after inactivity, the composer is replaced right away instead of staying active until the chat is reopened. - Resolved / closed banner. A finished chat now shows the web widget's footer instead of an empty space: "Conversation resolved" (or "Chat closed") with a short message and a Start new chat button. While the satisfaction survey is still pending, it shows the "rate this chat with the stars above" prompt instead.
ChatasistWidgetPagewires the button to the new-conversation flow, including the pre-chat form for unidentified visitors. - System messages.
WidgetMessagenow parsesevent_meta(eventMeta,eventKind). Operator-only events (chat_status_changed,chat_assignee_changed,chat_customer_merged) are never shown to the customer,first_contactis shown in the customer's language, and other events fall back to their stored text. After sending, the thread is reloaded fromGET chats/{id}so events in the send response (which carries noevent_meta) cannot leak through. - Localized UI (az / en / ru / tr). All plugin text — tab names, composer placeholder, home, messages, help, news, pre-chat form, survey, calls, banners — and all dates now follow the session language. Month names and relative times are built in, so they do not depend on the device having locale data. The language is the backend's
widget_localefrom the session (resolved fromChatasistWidgetOptions.language), falling back tolanguage, then English. Regional codes such asaz-AZare normalized toazbefore being sent, because the backend only matches exact codes. - Localized content. News and help topics are now requested with
?locale=set to the session language (previously they always came back in the backend's default, English), and new messages sendlanguageso AI replies and the survey invitation use it too. - Unread badge. The Messages badge now counts open conversations with an agent/AI message the customer has not seen. Read state is tracked per chat on the device (last seen message id, stored with the session), because the widget API has no customer read receipts. Resolved and closed chats are never counted, and opening a chat marks it read. On the first launch after upgrading, existing history counts as read, so the badge does not light up for old conversations.
- New public fields:
WidgetSession.widgetLocale/supportedLocales,WidgetChat.isFinished,WidgetMessage.eventMeta/eventKind/isHiddenFromCustomer.
1.6.0 #
- Added customer token support so the AI agent can look up a signed-in customer's own data (orders, account, cart) without asking them to confirm by code. Pass the token your backend issued for the customer and the plugin sends it with every request as
X-Customer-Token; Chatasist forwards it unchanged to your MCP server. Until now only the web widget could do this, so a customer who was signed in to the host app was still asked for a confirmation code. - New
ChatasistWidgetOptions.customerTokenProvider: a callback the plugin calls whenever it needs a current token — on the first request, and again once the held token is older thancustomerTokenRefreshInterval(default 10 minutes). Recommended for short-lived tokens: no timer needed in the host app. A provider that throws keeps the previous token and is retried after 30 seconds; returningnull(signed out) stops sending a token. - New
ChatasistWidgetOptions.customerTokenfor a token you already hold at startup, andchatasistFlutter.setCustomerToken(...)to set, replace, or clear it at runtime without reloading the conversation. - The token is held in memory only. It is never written to device storage.
- See the "Signed-in customers (customer token)" section in the README.
1.5.1 #
- Fixed a double border on the message composer input: when the host app's theme defines an
InputDecorationTheme(outlined borders and/or a fill colour), a second outlined, filled field was drawn inside the composer's own rounded border. The composer now clears every state border and the fill so it looks the same regardless of the host theme.
1.5.0 #
- Added
chatasistFlutter.onNewMessage, aStream<WidgetMessage>that emits each new agent/AI reply received live over the realtime socket (the customer's own messages are excluded). Host apps can listen to show an in-app toast/banner for new replies while the app is in the foreground, then open the widget withpresent()on tap. Background delivery still requires native push in the host app. - Added
chatasistFlutter.isPresentingso host apps can suppress the in-app toast while the widget is already on screen. - See the "Foreground new-message notifications" section in the README for a complete toast example.
1.4.2 #
- Removed the decorative green chat-bubble icon from the conversation screen header; the header now shows just the back button and the title.
1.4.1 #
- Fixed realtime delivery: the client subscribed to
private-App.Models.Customer.{id}andprivate-chat.{id}, but the backend broadcasts on — andPOST /api/widget/broadcasting/authonly authorizes — the tenant-scopedprivate-tenant.{companyId}.customer.{id}andprivate-tenant.{companyId}.chat.{id}channels. As a result every subscription was rejected and AI/agent replies never arrived over the socket; they only appeared on the next REST send.WidgetSessionnow parsescompany_idfromPOST /api/widget/session, andWidgetRealtimeClientsubscribes to the tenant-scoped channel names (falling back to the legacy names only when the backend sends nocompany_id).
1.4.0 #
- Migrated realtime from
pusher_channels_fluttertodart_pusher_channels(pure-Dart Pusher protocol client) so the widget can connect to a self-hosted / managed Laravel Reverb WebSocket host — the native Pusher SDK only supported Pusher Cloud clusters. POST /api/widget/sessionnow returns an optionalechoobject (host,port,scheme) when the backend broadcasts over Reverb;WidgetSessionexposes it asreverbHost/reverbScheme/reverbPort, and the client connects to that host (falling back to the Pusher Cloud cluster when absent).- Private channel authorization still flows through
POST /api/widget/broadcasting/auth(unchanged), now via a custom authorization delegate. - Fixed the message composer input: the placeholder/text now vertically centers against the send button instead of top-aligning.
1.3.0 #
- Hardcoded the widget backend to
https://api.chatasist.comand removed thebaseUrlfield fromChatasistWidgetOptions(use the newChatasistWidgetOptions.appUrlconstant to read it). - Added a pre-chat identify form (
WidgetPreChatScreen) that collects first name, last name, and an optional email before letting anonymous visitors start a new chat. Wired to the previously-unusedPOST /api/widget/identifyendpoint and gated on the newcustomer_identifiedflag returned byPOST /api/widget/session. - Added Open Graph–style link preview cards under chat bubbles via the previously-unused
GET /api/widget/link-previewendpoint, with per-session caching on the controller and tap-to-open viaurl_launcher. - Exposed
WidgetLinkPreviewon the public package barrel.
1.2.0 #
- Migrated widget voice/video calls from STUN-only P2P WebRTC to the Cloudflare Realtime SFU flow, matching the web and app-frontend clients.
- Added
cf_calls_client.dartimplementing the Dart Realtime SFU client (session/publish/pull/renegotiate) overflutter_webrtcandhttp. - Updated
WidgetCallEventto carrycaller_session_id,caller_track_ids, andrecording_enabledinstead of raw SDP offers. startCallnow returnsCallStartInfowithcf_token/cf_worker_url; removed legacyanswerCall/sendIceCandidatepaths and the.call.iceevent route.acceptIncomingmints a cf-token, publishes to the SFU, and pulls the caller's tracks;onCalleeAnsweredpulls the callee's tracks on.call.answered.
1.1.0 #
- Added session-driven AI greeting and initial resource shortcut chips on the new conversation screen.
- Added package SVG icon assets and replaced widget UI icon usage for closer parity with the web widget style.
- Improved secure storage handling by scoping JWT/identity keys per
baseUrlandchannelId, with legacy key migration. - Improved composer and thread messaging UX with stronger attachment/audio flows and richer in-thread quick action rendering.
- Improved chat/home/help/news/detail surfaces with updated layouts, spacing, and interaction polish.
1.0.13 #
- Improved conversation UI on mobile by removing the extra top greeting header in new chats and centering the welcome content.
- Added horizontal side insets for the card widget route so the chat sheet has spacing from screen edges.
- Kept keyboard behavior smooth while composing by retaining dismiss-on-tap-outside and drag-to-dismiss in the thread.
1.0.12 #
- Fixed conversation keyboard dismissal behavior so tapping outside input and dragging the message list now reliably closes the keyboard.
1.0.11 #
- Added a fallback
baseUrldefault ofhttps://app.chatasist.comwhenChatasistWidgetOptions.baseUrlis not specified.
1.0.10 #
- Added
url_launcherfor opening links from widget content in the host app environment. - Extended
WidgetChatandWidgetMessagemodels with survey-related fields for in-chat surveys. - Improved
WidgetRealtimeClienthandling for incoming realtime messages. - Refined widget UI padding, spacing, and tab styling for consistency across home, messages, news, and help flows.
1.0.6 #
- Added
flutter_htmlfor richer HTML rendering in widget surfaces. - Extended
ChatasistFlutterPluginwith JWT handling improvements and additional presentation options viaChatasistWidgetOptions. - Added news and topics fetching in
WidgetRepositoryfor the news tab experience. - Improved the message composer UI, including attachment selection and handling.
1.0.2 #
- Improved pub.dev package score by updating package metadata and API documentation.
- Added an OSI-approved license declaration and recognized license file.
1.0.1 #
- Improved usage guidance for integrating and launching the plugin.
- Improved README documentation for setup clarity and onboarding flow.
1.0.0 #
- Initial release of
chatasist_flutterpackage. - Added plugin singleton API with
initialize,setIdentity,present,dismiss, andrefresh. - Added native Flutter chat widget UI with chat list, conversation thread, and message composer.
- Added Widget Session bootstrap and JWT persistence for
/api/widget/session. - Added chat APIs integration for listing chats, fetching chat details, and sending messages.
- Added multipart attachment support for files, images, videos, and audios in widget messages.
- Added realtime integration with Pusher private channels and widget broadcasting auth endpoint.
- Added incoming call and call lifecycle handling with WebRTC signaling (
start,answer,ice,end). - Added package example app demonstrating initialization and opening the widget.
- Added initial unit and widget tests for core package behavior and session parsing.