Skip to main content

Prerequisites

You need:

Manual setup

1

Clone both repositories

git clone https://github.com/jmoraispk/loglife.git
git clone https://github.com/openclaw/openclaw.git ~/openclaw
2

Build OpenClaw

cd ~/openclaw
pnpm install
pnpm build
This compiles the OpenClaw gateway and CLI tools you’ll use in the next steps.
3

Install the LogLife plugin

cd ~/openclaw
./openclaw.mjs plugins install /path/to/loglife/plugin --link
The --link flag means the plugin loads directly from your LogLife repo — no files are copied. When you git pull new changes, the plugin updates automatically.
4

Generate an API key

cd ~/openclaw
./openclaw.mjs config set plugins.entries.loglife.config.apiKey "$(openssl rand -hex 32)"
This creates a random 256-bit key and stores it in ~/.openclaw/openclaw.json. You’ll need this key when configuring the website.To retrieve the key later:
grep apiKey ~/.openclaw/openclaw.json
5

Start the OpenClaw gateway

cd ~/openclaw
./openclaw.mjs gateway --allow-unconfigured
Verify the plugin loaded by hitting the endpoint:
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "http://localhost:18789/loglife/sessions?sessionId=test"
You should get a JSON response — either session data or {"error":"Session not found"}. Both mean the plugin is working.
If you already have an OpenClaw instance with sessions, try a real session ID to see actual data.

Automated setup

If you prefer a single script instead of manual steps, the plugin includes a production setup script that handles steps 3–5 automatically:
bash ~/loglife/plugin/setup.sh
The script installs the plugin, generates an API key (if not already set), restarts the gateway, and runs a health check. It prints the API key and next steps at the end.

Plugin updates

A GitHub Actions workflow triggers on pushes to main that change files in plugin/**. The workflow SSHes into your server and runs git pull to update the plugin code. See the CI/CD section for the full list of required secrets.

Troubleshooting

Make sure the name field in plugin/package.json matches the id in plugin/openclaw.plugin.json. Both should be "loglife".
Check that the gateway is running and the OPENCLAW_API_URL in your .env is correct. Test the connection directly:
curl -H "Authorization: Bearer YOUR_KEY" \
  "http://localhost:18789/loglife/sessions?sessionId=test"
Another gateway process may already be running. Kill it and try again:
pkill -f "openclaw gateway" && ./openclaw.mjs gateway --allow-unconfigured
The API key in your .env (or Vercel env vars) doesn’t match the key in ~/.openclaw/openclaw.json. Regenerate it and update both sides:
cd ~/openclaw
./openclaw.mjs config set plugins.entries.loglife.config.apiKey "$(openssl rand -hex 32)"
grep apiKey ~/.openclaw/openclaw.json