Skip to main content

Real-Time Updates via WebSocket

For instant score updates, connect via SignalR WebSocket. Available on Growth tier and above.

Connect

import { HubConnectionBuilder } from "@microsoft/signalr";

const connection = new HubConnectionBuilder()
.withUrl("https://crowdproof-api.azurewebsites.net/hubs/scores", {
headers: { "X-API-Key": "did_live_..." },
})
.withAutomaticReconnect()
.build();

connection.on("ScoreUpdated", (message) => {
console.log(`${message.address}: ${message.category} = ${message.newScore}`);
});

await connection.start();

Subscribe

// Subscribe to a specific address
await connection.invoke("SubscribeToAddress", "0x1234...");

// Subscribe to all score updates
await connection.invoke("SubscribeToAll");

// Unsubscribe
await connection.invoke("UnsubscribeFromAddress", "0x1234...");

Message Format

{
"address": "0x1234...",
"category": "DEFI_LENDING",
"previousScore": 720,
"newScore": 742,
"confidence": 0.91,
"tier": "High",
"timestamp": "2026-02-27T12:00:00Z"
}

Webhooks vs WebSocket

FeatureWebhooksWebSocket
Minimum tierStarterGrowth
Delivery modelPush to your URLPersistent connection
LatencySecondsMilliseconds
ReliabilityHMAC-signed, retriesAuto-reconnect
Best forServer-to-serverReal-time UIs