Overview

The Allternit Cloud Backend (@allternit/cloud-backend-service) is a lightweight WebSocket server for browser extension and thin-client integrations. It handles client authentication, session management, and real-time message forwarding between browser extensions and controlling clients. It is built from cmd/cloud-backend and runs as a standalone Node service.

Base URL

Default HTTP port: 8080.

Configuration

Health check

Response

Client types

WebSocket message format

WebSocket message types

Authentication

Connect to the WebSocket and send an auth message:

Response

The current implementation accepts any non-empty token and derives a user ID from it. Production deployments should validate tokens against an auth service.

Execute a browser action

A thin client or agent can request a browser action:
The server forwards the message to a browser-extension client in the same session. If no extension is connected, the caller receives:

Get browser tabs

Forwarded to the browser extension. If no extension is connected, the response is an empty array:

Chat messages

Thin clients can send chat messages:
The current implementation echoes the message back. In production, chat is forwarded to the AI runtime.

Session broadcast

Messages of type action:complete, tab:activated, and tab:updated are broadcast to all clients in the same session except the sender.

Connection cleanup

The server pings clients every 30 seconds and removes connections that have not sent any message or pong within 60 seconds.

Error codes

Running the service

Development: