Skip to content

Commit ce1f582

Browse files
committed
Update merged docs via GitHub Action
1 parent 2d14e48 commit ce1f582

3 files changed

Lines changed: 203 additions & 0 deletions

File tree

README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Ensemble provides a browser-based IDE, [Ensemble Studio](https://studio.ensemble
4747
- [SSL Configuration](#ssl-configuration)
4848
- [GraphQL](#graphql)
4949
- [Using WebSockets](#using-websockets)
50+
- [Server-Sent Events (SSE)](#server-sent-events-sse)
5051
- **Theme and Styling**
5152
- [Theme](#theme)
5253
- [Animations in EnsembleUI](#animations-in-ensembleui)
@@ -1246,6 +1247,7 @@ Following capabilities are also available in Ensemble:
12461247
- [SSL Configuration](api-ssl-configuration)
12471248
- [Chaining API calls](chaining-apis)
12481249
- [Websocket](websocket)
1250+
- [Server-Sent Events](sse)
12491251
- [GraphQL](graphql)
12501252

12511253
---
@@ -2194,6 +2196,105 @@ Ensemble supports following actions for WebSockets:
21942196

21952197
---
21962198

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
2235+
maxReconnectAttempts: 5 # Max retry attempts
2236+
2237+
onResponse: # Fired for each SSE event
2238+
executeCode:
2239+
body: |
2240+
// Process event data
2241+
var eventData = response.body.data;
2242+
2243+
onError: # Fired on connection error
2244+
executeCode:
2245+
body: |
2246+
console.error('SSE error:', response);
2247+
```
2248+
2249+
## Configuration Options
2250+
2251+
| Option | Description |
2252+
| --------------------------------- | ---------------------------------------------- |
2253+
| `type: sse` | **Required** – Enables SSE |
2254+
| `url` | SSE endpoint (`text/event-stream`) |
2255+
| `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+
21972298
# Theme
21982299

21992300
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.

public/llms-full.txt

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Ensemble provides a browser-based IDE, [Ensemble Studio](https://studio.ensemble
4747
- [SSL Configuration](#ssl-configuration)
4848
- [GraphQL](#graphql)
4949
- [Using WebSockets](#using-websockets)
50+
- [Server-Sent Events (SSE)](#server-sent-events-sse)
5051
- **Theme and Styling**
5152
- [Theme](#theme)
5253
- [Animations in EnsembleUI](#animations-in-ensembleui)
@@ -1246,6 +1247,7 @@ Following capabilities are also available in Ensemble:
12461247
- [SSL Configuration](api-ssl-configuration)
12471248
- [Chaining API calls](chaining-apis)
12481249
- [Websocket](websocket)
1250+
- [Server-Sent Events](sse)
12491251
- [GraphQL](graphql)
12501252

12511253
---
@@ -2194,6 +2196,105 @@ Ensemble supports following actions for WebSockets:
21942196

21952197
---
21962198

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
2235+
maxReconnectAttempts: 5 # Max retry attempts
2236+
2237+
onResponse: # Fired for each SSE event
2238+
executeCode:
2239+
body: |
2240+
// Process event data
2241+
var eventData = response.body.data;
2242+
2243+
onError: # Fired on connection error
2244+
executeCode:
2245+
body: |
2246+
console.error('SSE error:', response);
2247+
```
2248+
2249+
## Configuration Options
2250+
2251+
| Option | Description |
2252+
| --------------------------------- | ---------------------------------------------- |
2253+
| `type: sse` | **Required** – Enables SSE |
2254+
| `url` | SSE endpoint (`text/event-stream`) |
2255+
| `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+
21972298
# Theme
21982299

21992300
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.

public/llms.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Ensemble is a platform where you can build, publish, and iterate native and web
2222
- [SSL Configuration](https://docs.ensembleui.com/apis/api-ssl-configuration)
2323
- [GraphQL](https://docs.ensembleui.com/apis/graphql)
2424
- [Using WebSockets](https://docs.ensembleui.com/apis/websocket)
25+
- [Server-Sent Events (SSE)](https://docs.ensembleui.com/apis/sse)
2526
- [Theme](https://docs.ensembleui.com/theme-and-styling/theme)
2627
- [Animations in EnsembleUI](https://docs.ensembleui.com/theme-and-styling/animations)
2728
- [Using Custom Fonts](https://docs.ensembleui.com/theme-and-styling/custom-fonts)

0 commit comments

Comments
 (0)