web3.js WebSocket Provider

JSON →
library 4.0.8 ·javascript
verified Jun 7, 2026

WebSocket provider for web3.js 4.x (currently 4.0.8). Part of the web3.js v4 ecosystem, which migrated to ESM-only modules with native TypeScript support. Replaces the HTTP provider for real-time subscriptions (e.g., newBlockHeaders, logs). Key differentiators: supports reconnection with exponential backoff, custom headers, and authentication. Incompatible with web3.js v1.x provider APIs. Published under @ethereum-navigator scope; requires manual subscription management.