Understanding Events

Anatomy of an SSE Event

Each SSE event can have multiple fields. Here's what each one means:

id:42← Unique event identifier
event:message← Event type (custom name)
data:{"user":"john"}← Event payload
retry:3000← Reconnect delay (ms)
FieldRequiredDescription
idOptionalUnique identifier for the event. Used for reconnection - client sends Last-Event-ID header to resume.
eventOptionalEvent type name. Defaults to message if not specified. Common types: update, error, ping
dataRequired*The actual event payload. Usually JSON, but can be any text. Multiple data: lines are joined with newlines.
retryOptionalSuggested reconnection delay in milliseconds. Client should wait this long before reconnecting after a disconnect.

* Technically, an event can have no data field, but in practice, events without data are rarely useful. An event is dispatched when a blank line is received.

Event Display

Each event in the list shows key information at a glance:

14:32:01.234#42update{"message": "Hello, world!", "count": 123}
Expand icon
14:32:01Timestamp
#42Event ID
updateEvent type

Click any event to expand it and see the full details with two viewing modes.

Expanded Event View

When you click an event, it expands to show the full content with two tabs:

14:32:01.234#42update{"message": "Hello, world!"...
{
  "message": "Hello, world!",
  "count": 123,
  "timestamp": "2024-01-15T14:32:01Z"
}
ContentFormatted View

Shows the event data with automatic formatting:

  • • JSON is pretty-printed with indentation
  • • Non-JSON text is shown as-is
  • • Best for reading and understanding data
RawProtocol View

Shows the event in SSE protocol format:

id: 42
event: update
data: {"message": "Hello"}

Copying Events

Click the copy button to copy the event to your clipboard:

Content Tab Copy

Copies only the data field, formatted as JSON if possible:

{ "message": "Hello", "count": 123 }
Raw Tab Copy

Copies the full SSE event in protocol format:

id: 42
event: update
data: {"message": "Hello",
data: "count": 123}

Special Cases

Multiline Data

SSE protocol supports multiline data using multiple data: lines:

Server sends:
data: Line 1
data: Line 2
data: Line 3
(blank line)
Client receives:
Line 1
Line 2
Line 3
Default Event Type

If no event: field is specified, the event type defaults to message. In Tigrister, events with type "message" don't show the type badge to reduce clutter.

Comments (Keep-Alive)

Lines starting with : are comments and are ignored. Servers often use these as keep-alive pings:

: ping

Comments don't appear in the event list since they contain no data.

Empty Events

An event with no data field or empty data is valid but shows as (empty)in the event list. These are rare but can be used for signaling.