Centrifugo — Scalable Real-Time Messaging Server
You are an expert in Centrifugo, the scalable real-time messaging server. You help developers add WebSocket-based real-time features (chat, notifications, live updates, presence) to any application with a language-agnostic server that handles millions of concurrent connections — publishing from your backend via HTTP/gRPC API while clients subscribe via WebSocket, SSE, or HTTP streaming.
Best use case
Centrifugo — Scalable Real-Time Messaging Server is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
You are an expert in Centrifugo, the scalable real-time messaging server. You help developers add WebSocket-based real-time features (chat, notifications, live updates, presence) to any application with a language-agnostic server that handles millions of concurrent connections — publishing from your backend via HTTP/gRPC API while clients subscribe via WebSocket, SSE, or HTTP streaming.
Teams using Centrifugo — Scalable Real-Time Messaging Server should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/centrifugo/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Centrifugo — Scalable Real-Time Messaging Server Compares
| Feature / Agent | Centrifugo — Scalable Real-Time Messaging Server | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
You are an expert in Centrifugo, the scalable real-time messaging server. You help developers add WebSocket-based real-time features (chat, notifications, live updates, presence) to any application with a language-agnostic server that handles millions of concurrent connections — publishing from your backend via HTTP/gRPC API while clients subscribe via WebSocket, SSE, or HTTP streaming.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Centrifugo — Scalable Real-Time Messaging Server
You are an expert in Centrifugo, the scalable real-time messaging server. You help developers add WebSocket-based real-time features (chat, notifications, live updates, presence) to any application with a language-agnostic server that handles millions of concurrent connections — publishing from your backend via HTTP/gRPC API while clients subscribe via WebSocket, SSE, or HTTP streaming.
## Core Capabilities
### Server Setup
```bash
# Docker
docker run -d --name centrifugo -p 8000:8000 \
centrifugo/centrifugo:latest centrifugo \
--token_hmac_secret_key="your-secret" \
--api_key="your-api-key" \
--admin --admin_password="admin" \
--allowed_origins="*"
# Config file (config.json)
{
"token_hmac_secret_key": "your-256-bit-secret",
"api_key": "your-api-key",
"allowed_origins": ["https://myapp.com"],
"namespaces": [
{
"name": "chat",
"presence": true,
"join_leave": true,
"history_size": 100,
"history_ttl": "300s",
"force_recovery": true
},
{
"name": "notifications",
"presence": false,
"history_size": 50,
"history_ttl": "86400s"
}
]
}
```
### Client (Browser)
```typescript
import { Centrifuge } from "centrifuge";
const client = new Centrifuge("ws://localhost:8000/connection/websocket", {
token: userJwtToken, // JWT signed with your secret
});
// Subscribe to channel
const sub = client.newSubscription("chat:room-42");
sub.on("publication", (ctx) => {
console.log("New message:", ctx.data); // { user: "Alice", text: "Hello!" }
});
sub.on("join", (ctx) => {
console.log(`${ctx.info.user} joined`);
});
sub.on("leave", (ctx) => {
console.log(`${ctx.info.user} left`);
});
// Presence — who's online
const presence = await sub.presence();
console.log("Online users:", Object.values(presence.clients).map(c => c.user));
// History — missed messages (recovery)
const history = await sub.history({ limit: 50 });
history.publications.forEach(p => console.log(p.data));
sub.subscribe();
client.connect();
```
### Backend Publishing
```typescript
// Publish from your server via HTTP API
async function publishMessage(channel: string, data: any) {
await fetch("http://localhost:8000/api/publish", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "apikey your-api-key",
},
body: JSON.stringify({ channel, data }),
});
}
// Send chat message
await publishMessage("chat:room-42", {
user: "Alice",
text: "Hello everyone!",
timestamp: Date.now(),
});
// Send notification
await publishMessage("notifications:#user-123", {
type: "order_shipped",
title: "Your order has shipped!",
orderId: "ORD-456",
});
// JWT token generation (Node.js)
import jwt from "jsonwebtoken";
function generateToken(userId: string, channels: string[]) {
return jwt.sign(
{ sub: userId, channels },
process.env.CENTRIFUGO_SECRET!,
{ expiresIn: "24h" },
);
}
```
## Installation
```bash
# Server
docker pull centrifugo/centrifugo
# Or binary: https://github.com/centrifugal/centrifugo/releases
# Client SDK
npm install centrifuge # JavaScript/TypeScript
```
## Best Practices
1. **Server-side publish** — Clients subscribe via WebSocket; your backend publishes via HTTP API; separation of concerns
2. **JWT authentication** — Sign tokens server-side with HMAC secret; Centrifugo validates on connect
3. **Namespaces** — Configure per-channel behavior (presence, history, recovery); `chat:` for chat, `notifications:` for alerts
4. **Presence** — Enable for channels where "who's online" matters; adds overhead, disable for broadcast-only
5. **History recovery** — Enable `force_recovery` for chat; clients automatically catch up on reconnect
6. **Personal channels** — Use `#user-123` pattern for per-user notifications; only that user can subscribe
7. **Scalability** — Use Redis/Nats as broker for multi-node deployment; handles millions of connections
8. **Proxy** — Configure connect/subscribe/publish proxies to validate permissions via your backendRelated Skills
tracking-application-response-times
Track and optimize application response times across API endpoints, database queries, and service calls. Use when monitoring performance or identifying bottlenecks. Trigger with phrases like "track response times", "monitor API performance", or "analyze latency".
timeout-handler
Timeout Handler - Auto-activating skill for API Integration. Triggers on: timeout handler, timeout handler Part of the API Integration skill category.
forecasting-time-series-data
This skill enables Claude to forecast future values based on historical time series data. It analyzes time-dependent data to identify trends, seasonality, and other patterns. Use this skill when the user asks to predict future values of a time series, analyze trends in data over time, or requires insights into time-dependent data. Trigger terms include "forecast," "predict," "time series analysis," "future values," and requests involving temporal data.
time-series-decomposer
Time Series Decomposer - Auto-activating skill for Data Analytics. Triggers on: time series decomposer, time series decomposer Part of the Data Analytics skill category.
storybrand-messaging
Build clear brand messaging using narrative structure that positions the customer as hero. Use when the user mentions "brand message", "website copy", "elevator pitch", "one-liner", "messaging isn''t resonating", or "brand script". Covers landing page copy, marketing collateral, and consistent communication. For memorable messaging, see made-to-stick. For product positioning, see obviously-awesome. Trigger with 'storybrand', 'messaging'.
server-sent-events-setup
Server Sent Events Setup - Auto-activating skill for API Integration. Triggers on: server sent events setup, server sent events setup Part of the API Integration skill category.
analyzing-text-sentiment
This skill enables Claude to analyze the sentiment of text data. It identifies the emotional tone expressed in text, classifying it as positive, negative, or neutral. Use this skill when a user requests sentiment analysis, opinion mining, or emotion detection on any text, such as customer reviews, social media posts, or survey responses. Trigger words include "sentiment analysis", "analyze sentiment", "opinion mining", "emotion detection", and "polarity".
response-time-analyzer
Response Time Analyzer - Auto-activating skill for Performance Testing. Triggers on: response time analyzer, response time analyzer Part of the Performance Testing skill category.
implementing-real-user-monitoring
This skill assists in implementing Real User Monitoring (RUM) to capture and analyze actual user performance data. It helps set up tracking for key metrics like Core Web Vitals, page load times, and custom performance events. Use this skill when the user asks to "setup RUM", "implement real user monitoring", "track user experience", or needs assistance with "performance monitoring". It guides the user through choosing a RUM platform, designing an instrumentation strategy, and implementing the necessary tracking code.
building-websocket-server
Build scalable WebSocket servers for real-time bidirectional communication. Use when enabling real-time bidirectional communication. Trigger with phrases like "build WebSocket server", "add real-time API", or "implement WebSocket".
building-graphql-server
Build production-ready GraphQL servers with schema design, resolvers, and subscriptions. Use when building GraphQL APIs with schemas and resolvers. Trigger with phrases like "build GraphQL API", "create GraphQL server", or "setup GraphQL".
analyzing-market-sentiment
Analyze cryptocurrency market sentiment using Fear & Greed Index, news analysis, and market momentum. Use when gauging overall market mood, checking if markets are fearful or greedy, or analyzing sentiment for specific coins. Trigger with phrases like "analyze crypto sentiment", "check market mood", "is the market fearful", "sentiment for Bitcoin", or "Fear and Greed index".