Fluxta

Connections

Show the desktop whether the services you talk to are up.

A plugin that integrates with something — OBS, Twitch, a file server — holds a connection to it. The user wants to know whether that connection is alive without opening your settings page to find out.

Report your connections and the app's toolbar shows them: a dot and a connected/total count for the plugin as a whole, and a dropdown listing every connection by name. The indicator is a status surface, not a control panel: nothing to configure, and the only click opens the plugin's own editor.

Report what you are connected to

apps/plugin/src/index.ts
plugin.setConnections([
  { id: "main", title: "OBS Studio — Main", connected: true },
  { id: "backup", title: "OBS Studio — Backup", connected: false },
]);

That is the whole API. Each entry is:

FieldWhat it is
idYours to choose, and stable. It is how one connection is tracked across renames.
titleWhat the user reads in the dropdown — an instance name, an account.
connectedWhether the connection is up right now.

Nothing is declared in manifest.json, and there is no registration call. A plugin that never calls setConnections never appears in the indicator at all.

The list is the whole picture

setConnections replaces the previous list, so a connection missing from it is removed. Call it whenever a connection appears, disappears, or changes state:

apps/plugin/src/index.ts
obs.on("connectionChanged", () => {
  plugin.setConnections(
    obs.instances().map((instance) => ({
      id: instance.id,
      title: instance.name,
      connected: instance.connected,
    })),
  );
});

An empty array is a valid report: the plugin has no connections. Send it if the user removes the last one.

Reconnects are handled for you

Fluxta holds a plugin's connections only while its process is running — a stopped plugin has none, and none are shown for it. The SDK re-sends the last list after every reconnect, so unlike a pushed Value Source, there is nothing to repeat on connect. Report on change, and the list comes back by itself.

An unreadable snapshot is dropped

An entry with an empty id or title, or a connected that is not a boolean, makes Fluxta log a contract violation and drop that whole list. The plugin keeps running; the indicator simply does not update. Send a clean list.

What the user sees

  • The button carries the state of everything you reported: red when nothing is connected, yellow when some are, green when all are.
  • The dropdown groups connections by plugin, and shows each connection in the order you sent it.
  • Clicking the plugin's name opens its editor — its own tab, or its settings section — so a red dot is one click away from the page that can fix it.

A connection is not a Value Source

The indicator shows state to the user; it does not let an automation branch on it. If "is OBS connected" should drive an If/Else step, declare a Value Source as well, and push it from the same handler:

obs.on("connectionChanged", () => {
  plugin.setConnections(/* … */);
  plugin.setVariable("connected", obs.isConnected);
});

On this page