Skip to content
Ironflow is pre-1.0: APIs can change between releases. Pin a version. What is ready →

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.

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),
});

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"]

VariableDescription
dataThe event payload (JSON object).
topicThe full event topic string.
nameAlias for topic — the full topic string, not the bare event name.
timestampThe event creation time.