Skip to main content
All configuration is via environment variables.
VariableDefaultDescription
MERIDIAN_BIND0.0.0.0:3000TCP bind address
MERIDIAN_DATA_DIR./dataPath to sled storage directory
MERIDIAN_SIGNING_KEY(random)64-char hex ed25519 seed (32 bytes)
MERIDIAN_WEBHOOK_URL(unset)HTTP endpoint to receive webhook events
MERIDIAN_WEBHOOK_SECRET(unset)Secret for X-Meridian-Signature HMAC-SHA256

MERIDIAN_SIGNING_KEY

Generate a secure key:
openssl rand -hex 32
This key is used to sign and verify auth tokens. Keep it secret and back it up — losing it invalidates all issued tokens. If unset, a random key is generated at startup. This is fine for local development but not for production (tokens become invalid on restart).

Webhooks

When MERIDIAN_WEBHOOK_URL is set, Meridian sends a POST request to that URL after every successful CRDT operation. Payload
{
  "ns": "my-room",
  "crdt_id": "counter",
  "source": "http",
  "timestamp_ms": 1712345678901
}
source is either "http" (REST op) or "ws" (WebSocket op). Signature verification Every request includes an X-Meridian-Signature header containing HMAC-SHA256(secret, body) as a lowercase hex string.
import { createHmac } from "crypto";

const signature = createHmac("sha256", process.env.MERIDIAN_WEBHOOK_SECRET!)
  .update(rawBody)
  .digest("hex");

if (signature !== req.headers["x-meridian-signature"]) {
  return res.status(401).end();
}
Failed deliveries are retried up to 3 times with exponential backoff (200ms, 400ms, 800ms). Events are dropped if the internal queue (1024 slots) is full.

Rate limiting

Each token is limited to 100 requests per second (sliding window). Requests over the limit return 429 Too Many Requests:
{ "error": "rate_limited", "message": "too many requests" }

Metrics

Meridian exposes a Prometheus-compatible metrics endpoint at GET /metrics (no authentication required).
MetricTypeDescription
meridian_ops_totalCounterCRDT operations applied, labeled by ns, crdt_id, op_type
meridian_ws_connections_activeGaugeActive WebSocket connections
meridian_wal_entries_totalCounterWAL entries written
Example Prometheus scrape config:
scrape_configs:
  - job_name: meridian
    static_configs:
      - targets: ["localhost:3000"]
    metrics_path: /metrics

MERIDIAN_DATA_DIR

Meridian uses sled as its embedded database. The data directory contains the sled tree files. In Docker, this is mounted as a named volume:
volumes:
  - meridian-data:/data