Registry / messaging / pusher-websocket-iso

pusher-websocket-iso

JSON →
library0.2.0jsnpmunverified

EXPERIMENTAL isomorphic WebSocket client for Pusher (pub/sub). Version 0.2.0. Supports browser, Node.js, React Native, and Web Workers. Unlike the official pusher-js library, this package removes DOM dependency, JSONp authorization, and SockJS fallback for cross-environment compatibility. Uses XHR fallbacks built into the same file. Not suitable for production; use the official pusher-js for critical applications.

npm install pusher-websocket-iso
INSTALL
IMPORT
SIG · PUSHER-WEBSOCKET-I
P
pusher-websocket-iso
messagingjavascriptv0.2.0
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.

Pusher (default import)
import Pusher from 'pusher-websocket-iso'
import { Pusher } from 'pusher-websocket-iso'
Default import only; named export 'Pusher' does not exist.
Pusher (CommonJS)
const Pusher = require('pusher-websocket-iso')
Works in Node.js; for React Native use 'pusher-websocket-iso/react-native'.
Pusher (React Native)
const Pusher = require('pusher-websocket-iso/react-native')
const Pusher = require('pusher-websocket-iso')
Must use the specific React Native build to avoid DOM-related errors.

Initializes a Pusher client with app key and cluster, subscribes to a channel, and binds to an event.

// Node.js example const Pusher = require('pusher-websocket-iso'); const pusher = new Pusher('YOUR_APP_KEY', { cluster: 'eu', encrypted: true }); const channel = pusher.subscribe('my-channel'); channel.bind('my-event', function(data) { console.log('Received event:', data); });
Debug
Known issues
deprecatedThis package is experimental and not recommended for production. Use official pusher-js instead.
fix
Switch to https://github.com/pusher/pusher-js
affects: >=0.0.0
breakingJSONp channel authorization is not supported.
fix
Use XHR-based authorization (authEndpoint) instead.
affects: >=0.1.0
breakingSockJS fallback removed; no fallback for older browsers that lack XHR.
fix
Use the official pusher-js for legacy browser support.
affects: >=0.1.0
breakingXHR fallbacks are built into the same file, not dynamically loaded.
fix
No action needed if using modern browsers; may increase bundle size.
affects: >=0.1.0
gotchaReact Native requires importing from 'pusher-websocket-iso/react-native'.
fix
Ensure correct require path: const Pusher = require('pusher-websocket-iso/react-native');
affects: >=0.1.0
gotchaBower installation uses dist/web/pusher.js; UMD version at dist/web-umd/pusher.js.
fix
Use appropriate file for your module system.
affects: >=0.1.0
Errors
Common errors & fixes
Uncaught ReferenceError: Pusher is not defined
Script not loaded or wrong import path.
fix
Ensure <script src="bower_components/dist/web/pusher.js"></script> or correct import.
Module not found: Can't resolve 'pusher-websocket-iso'
Package not installed or typo in require/import.
fix
Run 'npm install pusher-websocket-iso' and check import path.
Cannot find module 'pusher-websocket-iso/react-native'
React Native build not included in npm package or wrong path.
fix
Ensure package version 0.2.0; use require('pusher-websocket-iso/react-native') exactly.
XMLHttpRequest is not defined
Using browser build in Node.js without polyfill.
fix
Use Node.js build (require('pusher-websocket-iso')) instead of browser script.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
pusher-websocket-iso — npm install pusher-websocket-iso · libregistry