Examples
Ready-to-use, copy-paste examples. Each one is a complete, working application — server code and client code included.
Realtime examples
Section titled “Realtime examples”Six examples built on the Aerostack Realtime SDK demonstrating different WebSocket patterns.
Realtime Chat Simple channel-based chat with HTTP message delivery and WebSocket broadcast. No persistence.
Live Presence Who's online, with auto-cleanup on disconnect. No server code required.
Collaborative Todos Shared todo list synced in real time with named events and optimistic updates.
Group Chat Multi-room chat with message history, presence, and participant lists.
Live Order Dashboard Subscribe to D1 table changes. Orders update in real time without any manual socket.emit.
AI Streaming Chat Token-by-token AI responses via WebSocket. One channel serves thousands of watchers.
Full applications
Section titled “Full applications”Run all examples locally
Section titled “Run all examples locally”Clone the examples repository and run the socket-hub demo:
# Clone and installgit clone https://github.com/aerostack/aerostackcd examples/socket-hubnpm install
# Set your project credentialscp .env.example .env# Edit .env: VITE_PROJECT_ID, VITE_API_KEY, VITE_API_URL
# Start the frontendnpm run dev
# In a separate terminal, start the servercd servernpm run devOpen http://localhost:5173 and open multiple tabs to see real-time sync in action.