Rooms presence subscribe

Open in

Use the ably rooms presence subscribe command to subscribe to presence events in a chat room.

Synopsis

ably rooms presence subscribe <room-name> [options]

Arguments

room-name
Required

The name of the chat room to subscribe to presence events in.

Options

--duration | -D

The duration in seconds to subscribe for before automatically unsubscribing.

--client-id

A client ID to use for the subscription.

--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 presence events in a room:

ably rooms presence subscribe my-room

Subscribe for a specific duration:

ably rooms presence subscribe my-room --duration 120

Subscribe to room presence events in JSON format:

ably rooms presence subscribe my-room --json

See also

  • Rooms — Explore all ably rooms commands.
  • CLI reference — Full list of available commands.