Registry / messaging / smartsupp-websocket

smartsupp-websocket

JSON →
library1.2.2jsnpmunverified

Official Smartsupp WebSocket SDK for JavaScript, version 1.2.2. Enables real-time communication with Smartsupp chat via socket.io. Key differentiator: official SDK with typed client creation, event-based messaging, and custom promise library support. Released on npm, TypeScript declarations included, compatible with browser and Node.js. Low release cadence.

npm install smartsupp-websocket
INSTALL
IMPORT
SIG · SMARTSUPP-WEBSOCKE
S
smartsupp-websocket
messagingjavascriptv1.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createVisitorClient
import { createVisitorClient } from 'smartsupp-websocket'
const createVisitorClient = require('smartsupp-websocket').createVisitorClient
ESM and CommonJS both supported; named import recommended for tree-shaking.
setPromiseLibrary
import { setPromiseLibrary } from 'smartsupp-websocket'
import * as smartsuppWebsocket from 'smartsupp-websocket'; smartsuppWebsocket.setPromiseLibrary(Promise)
setPromiseLibrary is a named export, not a method on default import.
default
import smartsuppWebsocket from 'smartsupp-websocket'
const smartsuppWebsocket = require('smartsupp-websocket').default
Module has both named and default exports; default import gives the main namespace.

Initializes a visitor client with account key, connects to Smartsupp, and listens for incoming chat messages.

import { createVisitorClient } from 'smartsupp-websocket'; const client = createVisitorClient({ data: { id: null, key: process.env.SMARTSUPP_KEY ?? '' }, }); client.connect().then((data) => { console.log('Connected with ID:', data.id); }); client.on('chat.message_received', (message) => { console.log('Message:', message); });
Debug
Known issues
breakingMajor version 1.x drops support for Node.js < 12
fix
Upgrade Node.js to version 12 or later.
affects: >=1.0.0
deprecatedThe 'createVisitorClient' function no longer accepts callback-based connect in v1.2.0+
fix
Use promise returned by connect() instead of callback.
affects: >=1.2.0
gotchaCalling connect() multiple times creates multiple connections without proper cleanup
fix
Always store the client instance and call disconnect() before re-connecting.
affects: >=0.0.0
gotchaEvent names are case-sensitive and might differ from Smartsupp API documentation
fix
Refer to the SDK's TypeScript type definitions for exact event names.
affects: >=0.0.0
gotchaSocket.IO client version must be compatible with the Smartsupp server; mismatches cause connection drops
fix
Keep socket.io-client dependency locked to the version specified by the SDK's package.json.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'smartsupp-websocket'
Package not installed or incorrect import path
fix
Run 'npm install smartsupp-websocket' and use correct import: import { createVisitorClient } from 'smartsupp-websocket'
TypeError: createVisitorClient is not a function
Incorrect import caused undefined export
fix
Use named import: import { createVisitorClient } from 'smartsupp-websocket'
Error: connect ECONNREFUSED
Cannot reach Smartsupp server; network issue or wrong account key
fix
Verify account key, ensure internet connection, check firewall/network restrictions.
Invalid 'key' provided in client data
Account key is null, undefined, or empty string
fix
Set a valid account key: { key: 'YOUR_SMARTSUPP_ACCOUNT_KEY' }
Upgrade
Version history
1.2.2latest on npm
Audit
Dependencies
socket.io-clientrequiredWebSocket engine for real-time communication
Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources
smartsupp-websocket — npm install smartsupp-websocket · libregistry