Registry / messaging / open-event-sdk

open-event-sdk

JSON →
library1.0.1jsnpmunverified

Open Event SDK for Node.js (v1.0.1) enables WebSocket-based event subscription for open platforms, primarily targeting WPS KSO ecosystem. It supports automatic reconnection with exponential backoff, KSO-1 signature authentication, and two event handling modes: single handler and dispatcher with per-event-code registration. Ships TypeScript definitions with typed event handlers for common events. Requires Node.js >=18. Compared to alternatives, it provides a typed, configurable WebSocket client with built-in reconnection and signature auth.

npm install open-event-sdk
INSTALL
IMPORT
SIG · OPEN-EVENT-SDK
O
open-event-sdk
messagingjavascriptv1.0.1
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.

Client
✓ import { Client } from 'open-event-sdk'
✗ const { Client } = require('open-event-sdk')
ESM-only package. CommonJS require will fail.
Dispatcher
✓ import { Dispatcher } from 'open-event-sdk'
✗ import { Dispatcher } from 'open-event-sdk/dispatcher'
Named export from main entry, not from subpath.
V7NotificationAppChatMessageCreateData
✓ import type { V7NotificationAppChatMessageCreateData } from 'open-event-sdk/event/model'
✗ import { V7NotificationAppChatMessageCreateData } from 'open-event-sdk'
Type-only import from subpath model; is not exported from main entry.

Creates a WebSocket client with a dispatcher that handles typed and custom events, then starts listening.

import { Client, Dispatcher } from 'open-event-sdk'; const dispatcher = new Dispatcher() .onV7AppChatMessageCreate((event) => { console.log(`Message: ${event.parsedData.message.id}`); }) .registerFunc('custom.event', (event) => { const data = JSON.parse(event.data); console.log('Custom event:', data); }); const client = new Client({ appId: process.env.APP_ID ?? '', appSecret: process.env.APP_SECRET ?? '', dispatcher, }); await client.start();
Debug
Known issues
gotchaThe package is ESM-only and requires Node.js >=18. Using require() will throw an error.
fix
Use 'import' syntax and ensure Node.js >=18 or use dynamic import().
affects: >=1.0.0
gotchaNot all events have onV7XXX methods; for unsupported events you must use registerFunc.
fix
Check documentation for list of supported onV7XXX methods, or use registerFunc for others.
affects: >=1.0.0
deprecatedThe onV7XXX methods are deprecated in favor of registerFunc with typed Data? (SDK version unclear, but README shows both).
fix
Use registerFunc for new code; onV7XXX may be removed in future.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'open-event-sdk/event/model'
Typo in subpath import or TypeScript tsconfig not set to 'node' moduleResolution.
fix
Ensure import path is exact: 'open-event-sdk/event/model' (case-sensitive). For TypeScript, set moduleResolution to 'node' or 'node16'.
ERR_REQUIRE_ESM
Using require() to load an ESM-only package.
fix
Switch to 'import' syntax or use dynamic import(). Ensure package.json has 'type': 'module'.
TypeError: dispatcher.onV7AppChatMessageCreate is not a function
Importing Dispatcher from wrong path or not instantiating correctly.
fix
Import { Dispatcher } from 'open-event-sdk' and instantiate with new Dispatcher() before calling methods.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
2
Amazon
1
Resources
open-event-sdk — npm install open-event-sdk · libregistry