Skip to main content
Grantex provides real-time event streaming endpoints that push authorization lifecycle events as they happen. Combined with the @grantex/destinations package, you can forward events to SIEMs, data warehouses, and message brokers without writing custom plumbing.

Architecture

The 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, set EVENT_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

Filter by event type with the 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 call stop() to flush pending events and close connections:

Custom Destinations

Implement the EventDestination interface to build your own:

Next Steps

Ownership

Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Ownership contact: sanjeev@orchestrum.in or mishra.sanjeev@gmail.com.
Last modified on October 10, 2026