{"id":49378,"library":"smartsupp-websocket","title":"Smartsupp WebSocket SDK","description":"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.","status":"active","version":"1.2.2","language":"javascript","source_language":"en","source_url":"git://github.com/smartsupp/smartsupp-sdk-websocket","tags":["javascript","typescript"],"install":[{"cmd":"npm install smartsupp-websocket","lang":"bash","label":"npm"},{"cmd":"yarn add smartsupp-websocket","lang":"bash","label":"yarn"},{"cmd":"pnpm add smartsupp-websocket","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"WebSocket engine for real-time communication","package":"socket.io-client","optional":false}],"imports":[{"note":"ESM and CommonJS both supported; named import recommended for tree-shaking.","wrong":"const createVisitorClient = require('smartsupp-websocket').createVisitorClient","symbol":"createVisitorClient","correct":"import { createVisitorClient } from 'smartsupp-websocket'"},{"note":"setPromiseLibrary is a named export, not a method on default import.","wrong":"import * as smartsuppWebsocket from 'smartsupp-websocket'; smartsuppWebsocket.setPromiseLibrary(Promise)","symbol":"setPromiseLibrary","correct":"import { setPromiseLibrary } from 'smartsupp-websocket'"},{"note":"Module has both named and default exports; default import gives the main namespace.","wrong":"const smartsuppWebsocket = require('smartsupp-websocket').default","symbol":"default","correct":"import smartsuppWebsocket from 'smartsupp-websocket'"}],"quickstart":{"code":"import { createVisitorClient } from 'smartsupp-websocket';\n\nconst client = createVisitorClient({\n    data: {\n        id: null,\n        key: process.env.SMARTSUPP_KEY ?? ''\n    },\n});\n\nclient.connect().then((data) => {\n    console.log('Connected with ID:', data.id);\n});\n\nclient.on('chat.message_received', (message) => {\n    console.log('Message:', message);\n});","lang":"typescript","description":"Initializes a visitor client with account key, connects to Smartsupp, and listens for incoming chat messages."},"warnings":[{"fix":"Upgrade Node.js to version 12 or later.","message":"Major version 1.x drops support for Node.js < 12","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use promise returned by connect() instead of callback.","message":"The 'createVisitorClient' function no longer accepts callback-based connect in v1.2.0+","severity":"deprecated","affected_versions":">=1.2.0"},{"fix":"Always store the client instance and call disconnect() before re-connecting.","message":"Calling connect() multiple times creates multiple connections without proper cleanup","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Refer to the SDK's TypeScript type definitions for exact event names.","message":"Event names are case-sensitive and might differ from Smartsupp API documentation","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Keep socket.io-client dependency locked to the version specified by the SDK's package.json.","message":"Socket.IO client version must be compatible with the Smartsupp server; mismatches cause connection drops","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.2.2':11 'base':32 'browser':47 'cadenc':52 'chat':19 'client':28 'communic':16 'compat':45 'creation':29 'custom':35 'declar':43 'differenti':23 'enabl':12 'event':31 'event-bas':30 'includ':44 'javascript':9,53 'key':22 'librari':37 'low':50 'messag':33 'node.js':49 'npm':41 'offici':4,24 'promis':36 'real':14 'real-tim':13 'releas':39,51 'sdk':3,7,25 'smartsupp':1,5,18 'socket.io':21 'support':38 'time':15 'type':27 'typescript':42,54 'version':10 'via':20 'websocket':2,6","created_at":"2026-06-07T17:01:28.421654+00:00","updated_at":"2026-06-07T17:01:28.421654+00:00","problems":[{"fix":"Run 'npm install smartsupp-websocket' and use correct import: import { createVisitorClient } from 'smartsupp-websocket'","cause":"Package not installed or incorrect import path","error":"Cannot find module 'smartsupp-websocket'"},{"fix":"Use named import: import { createVisitorClient } from 'smartsupp-websocket'","cause":"Incorrect import caused undefined export","error":"TypeError: createVisitorClient is not a function"},{"fix":"Verify account key, ensure internet connection, check firewall/network restrictions.","cause":"Cannot reach Smartsupp server; network issue or wrong account key","error":"Error: connect ECONNREFUSED"},{"fix":"Set a valid account key: { key: 'YOUR_SMARTSUPP_ACCOUNT_KEY' }","cause":"Account key is null, undefined, or empty string","error":"Invalid 'key' provided in client data"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/smartsupp/smartsupp-sdk-websocket#readme","github":"git://github.com/smartsupp/smartsupp-sdk-websocket","docs":null,"changelog":null,"pypi":null,"npm":"smartsupp-websocket","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}