Skip to main content

Ha Tang SDKs

Ha Tang's SDKs put the support chat inside your website and apps, and connect your servers to the Ha Tang API. Every chat client speaks the same realtime protocol with the gateway at chat.hatang.dev, so a customer who writes from your website, your mobile app, Zalo, Messenger, Instagram or TikTok Shop lands in the same inbox.

The SDKs​

PlatformPackageStatusGuide
Website (script tag)https://chat.hatang.dev/widget.jsStableWeb widget and JS API
React / Next.js@hatang/chat-reactStableReact and Next.js
WordPressHa Tang ChatStableWordPress plugin
Flutter (iOS, Android, web, desktop)hatang_chatStableFlutter
React Native / Expo@hatang/chat-react-nativeStableReact Native
iOS (Swift)HatangChatStableiOS
Android (Kotlin)dev.hatang:chatStableAndroid
Node.js (server)@hatang/sdkStableNode.js SDK
Python (server)hatangStablePython SDK
AI coding agents (MCP)@hatang/mcpNewMCP server

How they fit together​

On the web, the widget is the core. @hatang/chat-react loads the widget in a React app and the WordPress plugin loads it in a WordPress site. Both drive the same $hatang JavaScript API, and the widget follows the settings you make in the dashboard.

In mobile apps, the SDKs are native. The Flutter, React Native, iOS and Android SDKs do not embed a web view. Each one speaks the protocol to the gateway itself and ships its own chat screen, conversation list, launcher button, push notification helpers and deep links. They share one contract: the same page structure in these docs, the same events, and the same conformance scenarios (C01–C12) that every SDK must pass against a real gateway before a release. An app identifies itself with an app key (hak_...) instead of the browser's Origin.

On your server, use @hatang/sdk (Node.js) or hatang (Python). They call the REST API with an API key: send email, read and answer conversations as an agent, put plans and purchases on customers, sync customers, orders and the assistant's knowledge, create payments and verify webhooks. For PHP, Go or any other language, call the REST API directly.

Topics shared by every chat SDK​

  • Identity verification: identify with and without a signature, the identity secret, and how the inbox merges sessions.
  • Push notifications: upload a Firebase service account, when Ha Tang sends a push, and the payload.
  • Realtime protocol: the WebSocket frames, seq and resume, close codes, and downloadable JSON Schema.
  • Compatibility: SDK, protocol and minimum gateway versions, and the versioning policy.

Support matrix​

SDKStatusCurrentSupportedProtocolPlatforms
widget.jsStable—always current (served by the gateway)1Browsers with ES2020 (Chrome 80+, Safari 14+, Firefox 78+, Edge 80+)
@hatang/chat-reactStable0.1.20.1.x1React 18+; Next.js 14+ (App Router and Pages)
@hatang/sdkStable0.6.20.6.x1Node 20+; Bun 1.1+; Edge runtimes with fetch (User-Agent reports node/unknown)
hatang (Python)Stable0.1.10.1.x1Python 3.9+ (sync and asyncio, httpx)
hatang_chat (Flutter)Stable0.6.10.6.x1Flutter 3.32+; Dart 3.8+; iOS 15+; Android 6.0 (API 23)+; macOS 11+; Web; Windows 10+; Linux (secure storage falls back to preferences)
@hatang/chat-react-nativeStable0.4.20.4.x1React Native 0.76+; Expo SDK 52+
iOS (Swift)Stable0.4.10.4.x1iOS 17+; Swift 6 / Xcode 16+; SwiftUI and UIKit (HatangChatViewController)
Android (Kotlin)Stable0.4.10.4.x1Android 8+ (API 26); Kotlin 1.9+ / 2.x; Jetpack Compose (BOM 2024.12+); View-based apps open the chat through HatangChat.open
WordPress pluginStable0.2.30.2.x1WordPress 6.0+; PHP 7.4+

The full table, with packages and minimum gateway versions, is on Compatibility.

API references​

The SDK references are generated from the doc comments in each SDK's source and are in English.

Next steps​

View this page as Markdown