Spaces occupancy subscribe

Open in

Use the ably spaces occupancy subscribe command to subscribe to occupancy events on a space.

Synopsis

ably spaces occupancy subscribe <space-name> [options]

Arguments

space-name
Required

The name of the space to subscribe to occupancy events on.

Options

--duration | -D

The duration in seconds to subscribe for before automatically unsubscribing.

--client-id

A client ID to use when subscribing.

--json

Output results as compact JSON. Mutually exclusive with --pretty-json.

--pretty-json

Output results in formatted JSON. Mutually exclusive with --json.

--verbose | -v

Enable verbose logging. Can be combined with --json or --pretty-json.

Examples

Subscribe to occupancy events on a space:

ably spaces occupancy subscribe my-space

Subscribe for a specific duration:

ably spaces occupancy subscribe my-space --duration 60

Subscribe to space occupancy in JSON format:

ably spaces occupancy subscribe my-space --json

See also

  • Spaces — Explore all ably spaces commands.
  • CLI reference — Full list of available commands.