Registry / messaging / sim-sdk-web

sim-sdk-web

JSON →
library1.2.30jsnpmunverified

Sim SDK Web is a JavaScript/TypeScript SDK for integrating real-time instant messaging into web applications. It supports both SSE and WebSocket protocols, allowing developers to build chat features with flexible transport options. Current stable version is 1.2.30, released as needed. Key differentiators: dual protocol support (SSE and WebSocket) and TypeScript type definitions included. Compared to alternatives like Socket.IO, it is lighter and more focused on IM scenarios.

npm install sim-sdk-web
INSTALL
IMPORT
SIG · SIM-SDK-WEB
S
sim-sdk-web
messagingjavascriptv1.2.30
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.

SimSDK
import SimSDK from 'sim-sdk-web'
const SimSDK = require('sim-sdk-web')
ESM-only; CommonJS require is not supported.
SimClient
import { SimClient } from 'sim-sdk-web'
import SimClient from 'sim-sdk-web'
Named export; do not use default import.
EventTypes
import { EventTypes } from 'sim-sdk-web'
const EventTypes = require('sim-sdk-web').EventTypes
ESM-only; named export.

Initializes SDK with WebSocket protocol, connects, and sends a message.

import SimSDK from 'sim-sdk-web'; const sdk = new SimSDK({ appKey: process.env.APP_KEY ?? '', protocol: 'websocket', // or 'sse' onMessage: (msg) => console.log('Received:', msg), onError: (err) => console.error(err) }); sdk.connect().then(() => { sdk.sendMessage({ to: 'user123', content: 'Hello!' }); }).catch(console.error);
Debug
Known issues
gotchaBoth SSE and WebSocket are supported, but not all servers may support both protocols. Check server capabilities before choosing.
fix
Configure the SDK with the appropriate protocol based on server support.
affects: >=1.0.0
breakingVersion 1.0.0 introduced breaking changes: the constructor now requires an options object instead of separate parameters. For v0.x, the constructor used positional arguments.
fix
Update to use new options object format: new SimSDK({ appKey, protocol, ... })
affects: <1.0.0
deprecatedThe 'onDisconnect' callback was deprecated in v1.2.0; use 'onConnectionStateChange' instead.
fix
Replace 'onDisconnect' with 'onConnectionStateChange' callback.
affects: >=1.2.0
Errors
Common errors & fixes
Error: Cannot find module 'sim-sdk-web'
Package not installed or import path incorrect.
fix
Run 'npm install sim-sdk-web' or check import statement.
TypeError: SimSDK is not a constructor
CommonJS require used incorrectly (default export not available in CJS).
fix
Use ESM import: import SimSDK from 'sim-sdk-web'
Uncaught TypeError: sdk.sendMessage is not a function
SDK not fully initialized or method called before connect().
fix
Ensure .connect() promise resolves before calling sendMessage.
Upgrade
Version history
1.2.30latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
2
Amazon
1
Resources