The htmx.config.sse option is a configuration object for Server-Sent Events (SSE) behavior.
Default:
{ reconnect: false, reconnectDelay: 500, reconnectMaxDelay: 60000, reconnectMaxAttempts: 10, reconnectJitter: 0.3, pauseInBackground: false }
Properties
reconnect- Auto-reconnect on disconnectreconnectDelay- Initial delay in ms before reconnectingreconnectMaxDelay- Maximum delay in ms (uses exponential backoff)reconnectMaxAttempts- Maximum reconnection attemptsreconnectJitter- Jitter factor (0-1) to randomize reconnect timingpauseInBackground- Pause SSE streams when tab is not visible
Example
htmx.config.sse.reconnect = true; htmx.config.sse.reconnectDelay = 1000;
<meta name="htmx-config" content='{"sse":{"reconnect":true,"reconnectDelay":1000}}'>