Ironflow is pre-1.0: APIs can change between releases. Pin a version. What is ready →
- Events & Pub/Sub
- CEL Filtering
CEL Filtering
CEL (Common Expression Language) allows you to perform server-side filtering on event payloads. This significantly reduces bandwidth by only sending matching events to your client.
Basic Syntax
Section titled “Basic Syntax”Browser (Singleton):
import { ironflow } from "@ironflow/browser";
await ironflow.subscribe("events:order.*", { filter: 'data.total > 100.00', onEvent: (e) => console.log("High-value order:", e.data),});Node.js (Instance):
import { createSubscriptionClient } from "@ironflow/node";
const subClient = createSubscriptionClient({ serverUrl: "http://localhost:9123", apiKey: "...",});await subClient.connect();await subClient.subscribe("events:payment.*", { filter: 'data.status == "failed"', onEvent: (e) => notifyOps(e.data),});sub, _ := subClient.Subscribe(ctx, "events:order.*", &ironflow.SubscribeOptions{ Filter: `data.status == "completed"`,})from ironflow.rpc.v1 import SubscribeOptions, SubscribeRequest
for event in rpc.pubsub.subscribe(SubscribeRequest( pattern="events:order.*", options=SubscribeOptions(filter='data.status == "completed"'),)): print(event.data.to_python())String & Logic Operators
Section titled “String & Logic Operators”CEL supports standard string methods and logical operators for complex filtering.
- Contains:
data.email.contains("@company.com") - Regex:
data.id.matches("^[0-9]+$") - Logic:
data.priority == "high" && data.urgent == true - Lists:
data.category in ["billing", "auth"]
Available Variables
Section titled “Available Variables”| Variable | Description |
|---|---|
data | The event payload (JSON object). |
topic | The full event topic string. |
name | Alias for topic — the full topic string, not the bare event name. |
timestamp | The event creation time. |