AsyncAPI specification for Knock's real-time in-app notification feed transport. Knock exposes a Phoenix Channels WebSocket that pushes feed updates to subscribed clients. The connection is initiated by Knock's client SDKs (e.g. `@knocklabs/client`), which wrap a `phoenix` JS `Socket` and `Channel` to subscribe to per-user feed topics. Sources used to build this spec (no fabricated events): - https://docs.knock.app/in-app-ui/api-overview (documents the `new-message` real-time event) - https://docs.knock.app/in-app-ui/feeds/overview - https://docs.knock.app/in-app-ui/feeds/socket-behavior - https://github.com/knocklabs/javascript (open-source SDK that defines the socket URL pattern, channel topic format, and event payload shape used by Knock's in-app feed service) The single server-pushed domain event is `new-message`. The other `items.*` and `messages.new` names exposed by Knock's JavaScript SDK are *client-side* re-broadcasts derived from this event plus REST responses; they are not Phoenix wire events and are therefore not modeled as messages on this channel.
Phoenix Channel control frames sent by the client.
Per-user, per-feed Phoenix Channel topic. `feed_id` is the Knock in-app feed channel identifier (a UUID configured in the Knock dashboard). `user_id` is the Knock user identifier of the authenticated recipient. Source: `socketChannelTopic` in the Knock JS SDK returns ``feeds:${feedId}:${userId}`` and the in-source comment in `socket-manager.ts` documents the topic as `feeds::`.
Messages
✉
NewMessage
New Message
Emitted by Knock when a new in-app message has been produced for the subscribed user/feed. Does not contain the full message; it carries the updated feed `metadata` (badge counts) and an `attn` list naming which feed-client reference ids should react.
✉
PhxJoin
Phoenix Join
Client request to join the feed channel.
✉
PhxLeave
Phoenix Leave
Client request to leave the feed channel.
✉
PhxHeartbeat
Phoenix Heartbeat
Periodic heartbeat sent by the client to keep the socket alive.
✉
PhxReply
Phoenix Reply
Server reply to a client push (e.g. response to `phx_join`).
✉
PhxError
Phoenix Error
Channel-level error pushed by the server.
✉
PhxClose
Phoenix Close
Channel closed by the server.
Servers
wss
productionapi.knock.app/ws/v1
Knock production Phoenix WebSocket endpoint. The base URL is derived from the SDK default host `https://api.knock.app` with `http` replaced by `ws`, suffixed with `/ws/v1` (see `@knocklabs/client` `ApiClient` constructor).