C
CanxJS
v1.6.2
  • Learn
  • Blog
  • Showcase
C
CanxJS

Ultra-fast async MVC backend framework for Bun. Build production-ready APIs with elegance and speed.

Resources

  • Documentation
  • Learn
  • Blog
  • Showcase

Documentation

  • Introduction
  • Installation
  • Core Concepts
  • CLI Commands
  • API Reference

Legal

  • Privacy Policy
  • Terms of Service

© 2026 CanxJS. All rights reserved.

Built with ❤️ for Candra Kirana

Back to Learning Center
Advanced
30 min

Real-time with HotWire

Build real-time features with HotWire protocol.

Real-time with HotWire

HotWire allows you to push updates to the client without writing complex JavaScript.

The HotWire Protocol

CanxJS implements a custom HotWire protocol over WebSockets.

Broadcasting Events

To broadcast an event to the frontend:

typescript
import { broadcast } from "canxjs";

await broadcast("chat-room-1").emit("new-message", {
  text: "Hello World",
  user: "John Doe"
});

Client-Side Consumption

On the frontend (using the canx-client library):

javascript
import { echo } from "canx-client";

echo.channel("chat-room-1")
    .listen("new-message", (e) => {
        console.log(e.text);
    });

Have questions?

Join the discussion on GitHub