Getting started
Installation
Install Flock in your project and choose a server hosting path.
Client packages
Server options
Option 1: npx (quickest)
No install needed. Just run:
Environment variables:
| Variable | Default | Description |
|---|---|---|
FLOCK_PORT | 8787 | Port to listen on |
FLOCK_REDIS_URL | — | Redis URL for multi-instance mode |
FLOCK_API_KEYS | — | Comma-separated keys (omit for open mode) |
FLOCK_PRESENCE_TTL_SECONDS | 30 | Seconds before an idle user is evicted |
Option 2: Docker
With Redis (for scaling across multiple instances):
Option 3: Programmatic (embed in an existing Node server)
Requirements
- Node.js 22 or later
- React 18+ (for
@xevrion/flock-react)