# Interface SubscribeMessage

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

#### See

SignalK Specification: Subscription Protocol

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

- Defined in subscriptionmanager.ts:29

##### Index

### Properties

context
subscribe
announceNewPaths?

## Properties

### context

context: Context | RelativePositionOrigin

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

- Defined in subscriptionmanager.ts:33

### subscribe

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

  - ##### `Optional` minPeriod?: undefined

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

  - ##### `Optional` period?: number

    The subscription will be sent every period millisecs.

  - ##### `Optional` policy?: "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.

  - ##### `Optional` format?: "delta"

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

  - ##### `Optional` path?: Path

    The path to subscribe to.

- { minPeriod?: number; period?: undefined; policy?: "instant" } & {
  format?: "delta";
  path?: Path;
  }

  - ##### `Optional` minPeriod?: number

  - ##### `Optional` period?: undefined

  - ##### `Optional` policy?: "instant"

  - ##### `Optional` format?: "delta"

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

  - ##### `Optional` path?: Path

    The path to subscribe to.

- Defined in subscriptionmanager.ts:38

### `Optional` announceNewPaths

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.

- Defined in subscriptionmanager.ts:46