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
| Feature | Webhooks | WebSocket |
|---|---|---|
| Minimum tier | Starter | Growth |
| Delivery model | Push to your URL | Persistent connection |
| Latency | Seconds | Milliseconds |
| Reliability | HMAC-signed, retries | Auto-reconnect |
| Best for | Server-to-server | Real-time UIs |