Liking cljdoc? Tell your friends :D

supabase.realtime.protocol

Phoenix Channel v1.0.0 JSON wire protocol for Supabase Realtime.

Pure builders + parser. No I/O, no state. The connection module composes these into a transport-bound conversation.

Frame shape

{:topic    "realtime:room:lobby"
 :event    "phx_join"
 :payload  {...}
 :ref      "1"
 :join_ref "1"}    ; only on channel-bound messages

Event kinds

event-kind returns one of:

:phx-reply :phx-close :phx-error
:postgres-changes :broadcast
:presence-state :presence-diff
:system :heartbeat-reply :unknown
Phoenix Channel v1.0.0 JSON wire protocol for Supabase Realtime.

Pure builders + parser. No I/O, no state. The connection module composes
these into a transport-bound conversation.

## Frame shape

    {:topic    "realtime:room:lobby"
     :event    "phx_join"
     :payload  {...}
     :ref      "1"
     :join_ref "1"}    ; only on channel-bound messages

## Event kinds

`event-kind` returns one of:

    :phx-reply :phx-close :phx-error
    :postgres-changes :broadcast
    :presence-state :presence-diff
    :system :heartbeat-reply :unknown
raw docstring

access-token-frameclj

(access-token-frame ref join-ref topic token)

Builds an access_token event frame to refresh auth for a joined channel.

Builds an `access_token` event frame to refresh auth for a joined channel.
sourceraw docstring

broadcast-frameclj

(broadcast-frame ref join-ref topic event payload)

Builds a broadcast frame. Server echoes back to other subscribers (and to self when broadcast.self is enabled).

Builds a broadcast frame. Server echoes back to other subscribers
(and to self when `broadcast.self` is enabled).
sourceraw docstring

encodeclj

(encode frame)

JSON-encodes frame to a string.

JSON-encodes `frame` to a string.
sourceraw docstring

event-kindclj

(event-kind frame)

Returns the kind keyword for a decoded inbound frame. :unknown for events not recognized — caller should log + ignore.

Returns the kind keyword for a decoded inbound frame. `:unknown` for
events not recognized — caller should log + ignore.
sourceraw docstring

heartbeat-frameclj

(heartbeat-frame ref)

Builds a heartbeat frame on the reserved phoenix topic.

Builds a heartbeat frame on the reserved `phoenix` topic.
sourceraw docstring

join-frameclj

(join-frame ref topic config bindings access-token)

Builds a phx_join frame for topic with the given channel config and bindings vector. access-token is optional and added to the payload when present.

Builds a `phx_join` frame for `topic` with the given channel `config`
and `bindings` vector. `access-token` is optional and added to the
payload when present.
sourceraw docstring

leave-frameclj

(leave-frame ref join-ref topic)

Builds a phx_leave frame.

Builds a `phx_leave` frame.
sourceraw docstring

next-refclj

(next-ref counter)

Increments counter and returns the new value as a string.

Increments `counter` and returns the new value as a string.
sourceraw docstring

parse-frameclj

(parse-frame text)

Parses a JSON text frame into a Clojure map with keyword keys.

Payload values are returned as-is (postgres column names stay snake_case).

Parses a JSON text frame into a Clojure map with keyword keys.

Payload values are returned as-is (postgres column names stay snake_case).
sourceraw docstring

presence-track-frameclj

(presence-track-frame ref join-ref topic state)

Builds a presence track frame for the given state map.

Builds a presence track frame for the given `state` map.
sourceraw docstring

presence-untrack-frameclj

(presence-untrack-frame ref join-ref topic)

Builds a presence untrack frame.

Builds a presence untrack frame.
sourceraw docstring

realtime-topicclj

(realtime-topic topic)

Ensures a topic is prefixed with realtime:. Idempotent.

Ensures a topic is prefixed with `realtime:`. Idempotent.
sourceraw docstring

ref-counterclj

(ref-counter)

Returns an atom suitable for generating monotonic outgoing :ref ids.

Returns an atom suitable for generating monotonic outgoing `:ref` ids.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close