@grantex/destinations package, you can forward events to SIEMs, data warehouses, and message brokers without writing custom plumbing.
Architecture
EventSource class connects to the SSE stream and dispatches each event to one or more destinations you configure. Destinations buffer events and flush them in batches for efficiency.
Event Types
Each event has the same envelope:
SSE Endpoint
For self-hosting, setEVENT_STREAM_READY_ENABLED=true to send an initial
: connected SSE comment after the Redis subscription is ready. This flushes
an idle connection before the 30-second heartbeat so the dashboard can render
without waiting for an event. The flag defaults off and is enabled by hosted
deployments; set it to false to retain the previous response timing. It does
not change authentication, connection limits, or event payloads. Existing SDKs
ignore SSE comments, so no client upgrade is required.
Opted-in streams retain the server’s configured CORS and security headers;
cross-origin dashboards still need their exact origin in CORS_ALLOWED_ORIGINS.
GET /v1/events/stream returns a Server-Sent Events stream. Authenticate with your API key as a Bearer token.
curl
types query parameter (comma-separated):
TypeScript
Python
WebSocket Endpoint
GET /v1/events/ws upgrades to a WebSocket connection. Each message is a JSON-encoded event.
TypeScript
Python
@grantex/destinations Package
The@grantex/destinations package provides a high-level EventSource class that connects to the SSE stream and dispatches events to one or more destinations. Install it with:
Basic Usage
Available Destinations
Shared Configuration
All destinations accept these base options:Graceful Shutdown
Always callstop() to flush pending events and close connections:
Custom Destinations
Implement theEventDestination interface to build your own:
Next Steps
- Datadog Integration — monitors and alerting
- Splunk Integration — saved searches and dashboards
- S3 & BigQuery Archival — compliance archival
- Webhooks — push-based event delivery to your own endpoints
- Metrics & Observability — Prometheus metrics and Grafana dashboards