Use the ably push channels save command to subscribe a device or client to push notifications on a channel.
Synopsis
ably push channels save <channel-name> [options]Arguments
channel-name Required
Required
The channel to subscribe to.
Options
--device-id
The device ID to subscribe. Exclusive with --client-id.
--client-id
The client ID to subscribe. Exclusive with --device-id.
--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 a device to push notifications on a channel:
ably push channels save "my-channel" --device-id device-123Subscribe a client to push notifications on a channel:
ably push channels save "my-channel" --client-id client-1Save a push channel subscription and output in JSON format:
ably push channels save "my-channel" --device-id device-123 --jsonSee also
- Push — Explore all
ably pushcommands. - CLI reference — Full list of available commands.