API REFERENCE
WebSocket Feed
Consume real-time threats with zero latency.
Recommended: Use the SDK
The @sentinelguard/sdk package wraps the WebSocket connection and handles reconnection, JSON parsing, and protocol filtering for you. This is the recommended approach for most integrations.
subscribe.tstypescript
import SentinelClient from '@sentinelguard/sdk';
const client = new SentinelClient();
const unsubscribe = client.subscribe(
'YOUR_PROTOCOL_ADDRESS',
(alert) => {
console.log(`Alert: ${alert.rule_triggered} — severity ${alert.severity}`);
}
);See the SDK Reference for the full API including getAlerts(), getThreats(), and isPaused().
Raw WebSocket (Advanced)
Connect directly to the feed endpoint if you need full control or are working in a non-JS environment. No API key is required.
client.jsjavascript
const ws = new WebSocket('wss://sentinel-guard-three.vercel.app/feed');
ws.onmessage = (event) => {
const alert = JSON.parse(event.data);
console.log(`New alert! Score: ${alert.severity}`);
};Messages match the Alert Schema. Pings are sent every 30 seconds to keep the connection alive. You are responsible for reconnect logic when using the raw WebSocket.