Skip to content
Aquamarine logo

Aquamarine

Protocol-agnostic Beryl-style WebSocket channel client for Gleam on the BEAM.

Aquamarine is the client runtime for Beryl-style WebSocket channels in Gleam. It owns the lifecycle — connecting, joining a topic, heartbeats, ref counting, and orderly shutdown — and delegates the on-the-wire format to a pluggable Codec.

The bundled aquamarine/phoenix codec speaks the Phoenix Channels protocol, so Aquamarine talks to Beryl servers and to vanilla Phoenix Channels endpoints out of the box.

Terminal window
gleam add aquamarine
import aquamarine
import aquamarine/phoenix
import gleam/json
let assert Ok(channel) =
aquamarine.connect(
host: "localhost",
port: 4000,
path: "/socket/websocket",
topic: "room:lobby",
payload: json.object([]),
codec: phoenix.codec(),
)

Getting started

Install, connect, push, and receive in a handful of lines. Start here →

Phoenix & Beryl

Configure the bundled codec to talk to Phoenix Channels and Beryl. Read the guide →

Ecosystem

See where Aquamarine sits among Beryl, Gluegun, and Roost. View the map →