Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By tylerbutlerv1.0.0MITIn 1 marketplace
Gives Claude Gleam compiler diagnostics, go-to-definition, reference search and hover types for .gleam files in the project.
Trending plugins
7-day copy clicks
Language servers for diagnostics and code navigation.
1 marketplace, most starred first
gleam, lsp, language-server, diagnostics, go-to-definition, hover, code-navigation
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
![]() | berylType-safe real-time channels and presence for Gleam, compatible with Phoenix clients. |
[!IMPORTANT] beryl is not yet 1.0. Minor releases can change the API or remove features, and beryl is not ready for production. Try it and send feedback.
beryl runs real-time channels for Gleam applications on the BEAM. Clients join topics over WebSockets. Your handlers keep typed state for each joined topic and reply, push, or broadcast. beryl manages the socket processes, presence, PubSub across nodes, and abuse controls.
update function
when you need full control of routing and effect order.pg, without a separate
message broker.Sender. Raw dispatch receives it as socket.Info;
channels receive it in on_info. See
Send typed updates to one socket.on_connect, similar to
Phoenix UserSocket.connect/3. The hook can reject the connection before
any join, and ConnectSeed passes request data to your code.beryl_protocol runs the channel lifecycle on Erlang
or JavaScript hosts, such as a Cloudflare Durable Object.beryl packages install as Git dependencies from GitHub; they are not on Hex.
The installation guide shows the gleam.toml
entries for the latest release, the Gleam and Erlang/OTP versions beryl needs,
and how to pin a commit.
beryl includes the recommended beryl/channel API and raw dispatch. The
examples serve HTTP and WebSockets with Ewe
and beryl_ewe. If your application uses Mist, use
beryl_mist instead.
beryl, beryl_ewe, and beryl_mist run only on the Erlang (BEAM) target.
beryl_protocol also runs on JavaScript; see
Host the channel protocol yourself.
import beryl
import beryl/channel
import beryl/transport/server
import beryl/wire
import beryl_ewe
import ewe
import gleam/erlang/process
import gleam/http/request
import gleam/http/response
import gleam/json
import gleam/otp/static_supervisor
fn room() -> channel.Handler {
channel.handler("room:*", fn(context: channel.JoinContext(Nil)) {
channel.accept(Nil)
|> channel.on_message(fn(state, message: channel.Message) {
// Relay each client event to the other sockets in the room.
channel.next(state, [
channel.broadcast_from(
message.event,
json.object([#("from", json.string(context.socket_id))]),
),
channel.discard_reply(message.reply),
])
})
})
}
pub fn main() -> Nil {
let assert Ok(#(sockets, specification)) =
channel.supervised(beryl.config(wire.phoenix_codec()), handlers: [room()])
let assert Ok(_supervisor) =
static_supervisor.new(static_supervisor.OneForOne)
|> static_supervisor.add(specification)
|> static_supervisor.start()
// The Phoenix JS client connects to "/socket" plus "/websocket".
let assert Ok(_) =
beryl_ewe.handler(
sockets,
server.default_config("/socket/websocket"),
not_found,
)
|> ewe.new
|> ewe.listening(on: 8000)
|> ewe.start
process.sleep_forever()
}
fn not_found(
_request: request.Request(ewe.Connection),
) -> response.Response(ewe.Body) {
response.new(404)
|> response.set_body(ewe.Empty)
}
beryl_ewe.handler serves WebSockets and HTTP on one Ewe listener. It sends
WebSocket requests on /socket/websocket to beryl. Other requests go to the
HTTP fallback, which returns 404 here.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub tylerbutler/beryl --plugin gleam-lspPlugins from other owners that cover similar ground