Real-Time Streaming with WebSockets 🚀

Real-Time Streaming with WebSockets 🚀

We’re thrilled to announce a powerful new addition to our RPC toolkit: native WebSocket support for Plume Mainnet (chain ID 98866) and Testnet (chain ID 98867). Now you can subscribe to live block events and react instantly as new blocks are produced—no polling required

What’s New

  • WebSocket Endpoints
    • Mainnet:
      wss://98866.rpc.thirdweb.com/ws/<client_id>
    • Testnet
      wss://98867.rpc.thirdweb.com/ws/<client_id>
  • Real-Time Block Events
    Subscribe once and receive a continuous stream of block headers and payloads as they’re finalized on-chain.

Why You’ll Love It

  1. Instant Data
    No more waiting for HTTP responses—get block notifications the moment they happen.
  2. Lower Latency
    Maintain a persistent socket connection instead of hammering REST endpoints.
  3. Scalability
    Stream to multiple clients or services without spinning up extra request handlers.

Getting Started

  1. Generate or retrieve your <client_id> from your Thirdweb dashboard.
  2. Connect via your favorite WebSocket library:
import WebSocket from "ws";

const chainId = "98866";            // or "98867" for Testnet
const clientId = "<your_client_id>";
const wsUrl   = `wss://${chainId}.rpc.thirdweb.com/ws/${clientId}`;

const ws = new WebSocket(wsUrl);

ws.on("open", () => {
  console.log("Connected to Plume WebSocket!");
  // Subscribe to new block events
  ws.send(JSON.stringify({ 
    id: 1, 
    jsonrpc: "2.0", 
    method: "eth_subscribe", 
    params: ["newHeads"] 
  }));
});

ws.on("message", (data) => {
  const event = JSON.parse(data);
  console.log("New block received:", event);
});
  1. Handle Events
    Every newHeads message includes block number, hash, timestamp, and parent hash—ready for indexing, alerts, or analytics.

What’s Next

  • More Chains Coming Soon!
    We’re actively working on extending WebSocket support across additional networks. Stay tuned for announcements!