You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [Animations in EnsembleUI](#animations-in-ensembleui)
@@ -1246,6 +1247,7 @@ Following capabilities are also available in Ensemble:
1246
1247
- [SSL Configuration](api-ssl-configuration)
1247
1248
- [Chaining API calls](chaining-apis)
1248
1249
- [Websocket](websocket)
1250
+
- [Server-Sent Events](sse)
1249
1251
- [GraphQL](graphql)
1250
1252
1251
1253
---
@@ -2194,6 +2196,105 @@ Ensemble supports following actions for WebSockets:
2194
2196
2195
2197
---
2196
2198
2199
+
# Server-Sent Events (SSE)
2200
+
2201
+
Server-Sent Events (SSE) is a web standard that allows a server to push real-time updates to a client over a single HTTP connection. Unlike WebSockets, SSE is **unidirectional (server → client)** and includes **automatic reconnection**.
2202
+
2203
+
For a complete working example demonstrating SSE functionality including connection management, event handling, error handling, and UI integration, see the [SSE Kitchen Sink example](https://studio.ensembleui.com/app/e24402cb-75e2-404c-866c-29e6c3dd7992/screen/rAmWKmUWonS4rWiHuhte) in Ensemble Studio.
2204
+
2205
+
2206
+
## Key Features
2207
+
2208
+
* **Unidirectional**: Server pushes data to the client
2209
+
* **Auto-reconnect**: Automatically reconnects on connection loss
2210
+
* **HTTP-based**: Uses standard HTTP (`text/event-stream`)
2211
+
* **Event-driven**: Supports event types, IDs, and payloads
2212
+
* **Simple API**: Easy to configure and manage
2213
+
2214
+
## Common Use Cases
2215
+
2216
+
* Real-time notifications and alerts
2217
+
* Live data feeds (stocks, sports scores)
2218
+
* Progress updates for long-running tasks
2219
+
* One-way chat or messaging
2220
+
* Live dashboards and monitoring
2221
+
* News feeds and social updates
2222
+
2223
+
## Define an SSE API
2224
+
2225
+
To use SSE in Ensemble, define an API with `type: sse` and provide the SSE endpoint along with optional connection settings.
2226
+
2227
+
```yaml
2228
+
API:
2229
+
sseEvents:
2230
+
type: sse # Required
2231
+
url: https://sse.dev/test # SSE endpoint
2232
+
sseOptions:
2233
+
autoReconnect: true # Automatically reconnect
2234
+
reconnectDelay: 1000 # Delay (ms) before reconnect
| `sseOptions.autoReconnect` | Auto-reconnect on disconnect (default: `true`) |
2256
+
| `sseOptions.reconnectDelay` | Delay between retries in ms (default: `1000`) |
2257
+
| `sseOptions.maxReconnectAttempts` | Max reconnect attempts (default: `5`) |
2258
+
| `onResponse` | Executed for each received event |
2259
+
| `onError` | Executed on SSE errors |
2260
+
2261
+
## Event Response Structure
2262
+
2263
+
Each event received in `onResponse` contains:
2264
+
2265
+
```js
2266
+
response.body.event // Event name (default: "message")
2267
+
response.body.id // Event ID (if provided)
2268
+
response.body.data // Event payload (text or JSON)
2269
+
```
2270
+
2271
+
## Disconnect from SSE
2272
+
2273
+
Use the built-in action to disconnect from an SSE connection:
2274
+
2275
+
```yaml
2276
+
disconnectSSE:
2277
+
apiName: sseEvents
2278
+
```
2279
+
2280
+
```javascript
2281
+
ensemble.disconnectSSE({apiName: "sseEvents"});
2282
+
```
2283
+
2284
+
## Summary
2285
+
2286
+
Ensemble's SSE support provides:
2287
+
2288
+
* Simple real-time data streaming
2289
+
* Automatic reconnection
2290
+
* Built-in lifecycle management
2291
+
* Easy UI integration
2292
+
* Clean event handling
2293
+
2294
+
This makes SSE ideal for **live dashboards, notifications, and streaming updates** without the complexity of WebSockets.
2295
+
2296
+
---
2297
+
2197
2298
# Theme
2198
2299
2199
2300
From color schemes to typography, widgets, and transition options, our comprehensive range of theme elements allows you to effortlessly personalize your app. Discover how themes can transform your online presence, create a cohesive brand identity, and provide a delightful user experience. Unlock the full potential of your app with our versatile and user-friendly theme customization features.
- [Animations in EnsembleUI](#animations-in-ensembleui)
@@ -1246,6 +1247,7 @@ Following capabilities are also available in Ensemble:
1246
1247
- [SSL Configuration](api-ssl-configuration)
1247
1248
- [Chaining API calls](chaining-apis)
1248
1249
- [Websocket](websocket)
1250
+
- [Server-Sent Events](sse)
1249
1251
- [GraphQL](graphql)
1250
1252
1251
1253
---
@@ -2194,6 +2196,105 @@ Ensemble supports following actions for WebSockets:
2194
2196
2195
2197
---
2196
2198
2199
+
# Server-Sent Events (SSE)
2200
+
2201
+
Server-Sent Events (SSE) is a web standard that allows a server to push real-time updates to a client over a single HTTP connection. Unlike WebSockets, SSE is **unidirectional (server → client)** and includes **automatic reconnection**.
2202
+
2203
+
For a complete working example demonstrating SSE functionality including connection management, event handling, error handling, and UI integration, see the [SSE Kitchen Sink example](https://studio.ensembleui.com/app/e24402cb-75e2-404c-866c-29e6c3dd7992/screen/rAmWKmUWonS4rWiHuhte) in Ensemble Studio.
2204
+
2205
+
2206
+
## Key Features
2207
+
2208
+
* **Unidirectional**: Server pushes data to the client
2209
+
* **Auto-reconnect**: Automatically reconnects on connection loss
2210
+
* **HTTP-based**: Uses standard HTTP (`text/event-stream`)
2211
+
* **Event-driven**: Supports event types, IDs, and payloads
2212
+
* **Simple API**: Easy to configure and manage
2213
+
2214
+
## Common Use Cases
2215
+
2216
+
* Real-time notifications and alerts
2217
+
* Live data feeds (stocks, sports scores)
2218
+
* Progress updates for long-running tasks
2219
+
* One-way chat or messaging
2220
+
* Live dashboards and monitoring
2221
+
* News feeds and social updates
2222
+
2223
+
## Define an SSE API
2224
+
2225
+
To use SSE in Ensemble, define an API with `type: sse` and provide the SSE endpoint along with optional connection settings.
2226
+
2227
+
```yaml
2228
+
API:
2229
+
sseEvents:
2230
+
type: sse # Required
2231
+
url: https://sse.dev/test # SSE endpoint
2232
+
sseOptions:
2233
+
autoReconnect: true # Automatically reconnect
2234
+
reconnectDelay: 1000 # Delay (ms) before reconnect
| `sseOptions.autoReconnect` | Auto-reconnect on disconnect (default: `true`) |
2256
+
| `sseOptions.reconnectDelay` | Delay between retries in ms (default: `1000`) |
2257
+
| `sseOptions.maxReconnectAttempts` | Max reconnect attempts (default: `5`) |
2258
+
| `onResponse` | Executed for each received event |
2259
+
| `onError` | Executed on SSE errors |
2260
+
2261
+
## Event Response Structure
2262
+
2263
+
Each event received in `onResponse` contains:
2264
+
2265
+
```js
2266
+
response.body.event // Event name (default: "message")
2267
+
response.body.id // Event ID (if provided)
2268
+
response.body.data // Event payload (text or JSON)
2269
+
```
2270
+
2271
+
## Disconnect from SSE
2272
+
2273
+
Use the built-in action to disconnect from an SSE connection:
2274
+
2275
+
```yaml
2276
+
disconnectSSE:
2277
+
apiName: sseEvents
2278
+
```
2279
+
2280
+
```javascript
2281
+
ensemble.disconnectSSE({apiName: "sseEvents"});
2282
+
```
2283
+
2284
+
## Summary
2285
+
2286
+
Ensemble's SSE support provides:
2287
+
2288
+
* Simple real-time data streaming
2289
+
* Automatic reconnection
2290
+
* Built-in lifecycle management
2291
+
* Easy UI integration
2292
+
* Clean event handling
2293
+
2294
+
This makes SSE ideal for **live dashboards, notifications, and streaming updates** without the complexity of WebSockets.
2295
+
2296
+
---
2297
+
2197
2298
# Theme
2198
2299
2199
2300
From color schemes to typography, widgets, and transition options, our comprehensive range of theme elements allows you to effortlessly personalize your app. Discover how themes can transform your online presence, create a cohesive brand identity, and provide a delightful user experience. Unlock the full potential of your app with our versatile and user-friendly theme customization features.
0 commit comments