Standalone WebSocket client for the StarComm desktop application.

Connects to the StarComm desktop app's Mobile Remote WebSocket endpoint (ws://<host>:<port>/control?token=<pairing_token>).

This client is completely independent from StarCommsClient (the shard Owner API client). It requires only the pairing token from StarComm's settings (Settings → Mobile Remote).

  • pttStart(netId) — Momentary mode. Mimics holding a physical PTT button. Releases automatically if not sustained (used by the phone app's press-and-hold gesture).
  • pttHold(netId) — Toggle/latch mode. Tap once to lock transmission on, call pttStop(netId) to release. Use this for programmatic PTT.
  • pttStop(netId) — Release transmission on a net.
import { StarCommsLocalClient } from "@30k/starcomm-client";

const local = new StarCommsLocalClient({
token: "your_pairing_token",
// host: "127.0.0.1", // default
// port: 8798, // default
});

local.on("snapshot", (snapshot) => {
console.log(`Connected as ${snapshot.displayName}`);
console.log(`Active net: ${snapshot.ptt.channel}`);
});

local.onLifecycle("disconnected", ({ reason }) => {
console.warn("Lost connection to StarComm:", reason);
});

await local.connect();

// PTT control (use pttHold for sustained transmission)
local.pttHold(255); // latch on
local.pttStop(255); // release

// Admin commands (only work if user has admin access)
local.adminAssign("user123", 2);
local.adminAcars("Fleet depart in 5 minutes");

// Disconnect when done
local.disconnect();

Constructors

Properties

snapshot: null | LocalSnapshot = null

The most recent snapshot received from the local client.

Accessors

Methods

  • Admin: send an ACARS alert to all users.

    Parameters

    • text: string

    Returns void

  • Admin: assign a user to a net.

    Parameters

    • userId: string
    • netId: number

    Returns void

  • Admin: disconnect a user.

    Parameters

    • userId: string

    Returns void

  • Admin: unassign a user from a net.

    Parameters

    • userId: string
    • netId: number

    Returns void

  • Open the WebSocket connection to the local StarComm app. Resolves when the connection is open and the hello handshake has been sent. Rejects if the initial connection fails.

    Returns Promise<void>

  • Close the connection. Will not trigger automatic reconnection.

    Returns void

  • Toggle/latch PTT on a net. Locks transmission on until pttStop is called. Use this for programmatic or sustained PTT.

    Parameters

    • netId: number

    Returns void

  • Start momentary push-to-talk on a net. This mimics holding a physical PTT button — releases automatically if not sustained. For programmatic PTT, use pttHold instead.

    Parameters

    • netId: number

    Returns void

  • Release push-to-talk on a net.

    Parameters

    • netId: number

    Returns void

  • Request a fresh snapshot from the local client.

    Returns void