Preparing search index...

    Interface SubscribeMessage

    A message to allow a client to subscribe for data updates from a signalk server

    interface SubscribeMessage {
        context: Context | RelativePositionOrigin;
        subscribe: (
            | { minPeriod?: undefined; period?: number; policy?: "fixed" } & {
                format?: "delta";
                path?: Path;
            }
            | { minPeriod?: number; period?: undefined; policy?: "instant" } & {
                format?: "delta";
                path?: Path;
            }
        )[];
        announceNewPaths?: boolean;
        excludeSelf?: boolean;
        excludeSources?: SourceRef[];
        sourcePolicy?: "preferred"
        | "all";
    }
    Index

    Properties

    The context path for all subsequent paths, usually a vessel's path.

    subscribe: (
        | { minPeriod?: undefined; period?: number; policy?: "fixed" } & {
            format?: "delta";
            path?: Path;
        }
        | { minPeriod?: number; period?: undefined; policy?: "instant" } & {
            format?: "delta";
            path?: Path;
        }
    )[]

    An array of paths to subscribe to, with optional criteria

    Type Declaration

    • { minPeriod?: undefined; period?: number; policy?: "fixed" } & {
          format?: "delta";
          path?: Path;
      }
      • OptionalminPeriod?: undefined

        If policy=immediate or ideal, consecutive messages will be buffered until minPeriod has expired so the receiver is not swamped.

      • Optionalperiod?: number

        The subscription will be sent every period millisecs.

      • Optionalpolicy?: "fixed"
        • fixed - Send the last known values every period.
        • inline - Send all changes as fast as they are received, but no faster than minPeriod. With this policy the client has an immediate copy of the current state of the server.
      • Optionalformat?: "delta"

        The signal K format to use for the message. Only delta is currently supported. See Signal K Data Model

      • Optionalpath?: Path

        The path to subscribe to.

    • { minPeriod?: number; period?: undefined; policy?: "instant" } & {
          format?: "delta";
          path?: Path;
      }
      • OptionalminPeriod?: number
      • Optionalperiod?: undefined
      • Optionalpolicy?: "instant"
      • Optionalformat?: "delta"

        The signal K format to use for the message. Only delta is currently supported. See Signal K Data Model

      • Optionalpath?: Path

        The path to subscribe to.

    announceNewPaths?: boolean

    When true, the server will send cached values for ALL paths matching the context filter once (for discovery), plus announce any new paths that appear later. This allows clients using granular subscriptions to discover available paths without subscribing to everything continuously.

    excludeSelf?: boolean

    Plugin-API shorthand for excludeSources: [<this plugin's id>]. Resolved on the server side, so plugins don't need to know their own id. Useful for plugins that publish on the same path they consume — without the exclude their own output would dominate the priority cascade and they'd never see any other source.

    Only meaningful for subscriptions made through app.subscriptionmanager.subscribe() from inside a plugin. On WebSocket subscriptions there is no plugin identity to resolve against, and excludeSelf is ignored — WebSocket clients should use the explicit excludeSources form.

    Effective only when sourcePolicy is 'preferred' (the default).

    excludeSources?: SourceRef[]

    Drop the listed source refs from the candidate set used by the priority cascade. The subscription still receives the priority-resolved single winner per path, just computed over the remaining sources. Use this to let a derived-data plugin subscribe to upstream sources with the user's priority ranking applied, without seeing its own output in the cascade.

    Effective only when sourcePolicy is 'preferred' (the default). Ignored under sourcePolicy: 'all', which already bypasses priority resolution.

    When combined with excludeSelf, the union of both sets is excluded.

    sourcePolicy?: "preferred" | "all"

    Controls which sources are included in deltas.

    • preferred (default): only the preferred source per path (based on source priorities)
    • all: all sources for every path, useful for source comparison and diagnostics