@jokkoo/sdk-web
v1.3.0
Published
Jokkoo framework-agnostic client embed SDK core (API, realtime, token management)
Readme
@jokkoo/sdk-web
Framework-agnostic Jokkoo client embed SDK core: API client, realtime transport, token management, and shared utilities (formatting, i18n, message mapping, uploads).
UI bindings for specific frameworks (@jokkoo/sdk-react, @jokkoo/sdk-react-native, etc.) build on this package.
Install
pnpm add @jokkoo/sdk-webQuick start
import { Jokkoo, JokkooApiClient } from "@jokkoo/sdk-web"
Jokkoo.init({
clientToken: "ct_...",
userTokenProvider: async () => {
const res = await fetch("/api/jokkoo-token")
const data = await res.json()
return data.token as string
},
locale: "fr",
debug: true,
})
await Jokkoo.getRealtimeClient().connect()
const api = new JokkooApiClient(Jokkoo.getConfig(), Jokkoo.getTokenManager())
const conversations = await api.getConversations(20, 0)For React apps, prefer @jokkoo/sdk-react which wraps this core with a floating widget UI.
What's included
- Core —
Jokkoosingleton,TokenManager, config validation, debug logging - API — REST client for conversations, messages, uploads, satisfaction
- Realtime — Socket.IO client on namespace
/sdkand event constants - Lib — pure helpers (pagination, formatting, attachments, voice metering, satisfaction)
- i18n — English and French translation catalogs
Web channels
When using a web channel (channelType === "web"), configure allowed origins in the Jokkoo dashboard so the API accepts browser requests from your host app.
License
Apache-2.0
