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