Admin UI
The optional greenlight-ui Next.js app manages channels, prompts, and
dashboard stats. It talks to the core API server-side with a scoped
X-API-Key (GREENLIGHT_API_KEY).
Community self-host: one super admin account created at /setup; no org
switcher and no additional human users in the open-source UI today. Enterprise
and Cloud add multi-user and organization models — see
Editions & admin identity.
First-time setup
- Start the stack (
npm run devornpm run docker:full) - Open http://localhost:3001/setup
- Create the super admin (email + password, min 8 characters)
- Sign in at /login
If /setup redirects to /login and you never created an account, reset:
docker exec greenlight-dev-postgres psql -U greenlight -d greenlight \
-c "DELETE FROM admin_users;"Then visit /setup again.
Pages
| Path | Purpose |
|---|---|
/setup | First-run admin creation |
/login | Sign in |
/dashboard | Health and prompt stats |
/channels | Register / list / delete channels |
/messages | MESSAGE channel history and send |
/prompts | Create prompts and view history |
/settings | Connectivity, retention, and account |
Register a channel in the UI
- Go to Channels → Add channel
- Choose platform and channel type (
PROMPTorMESSAGE) - Enter
channel_id(stable slug),target_chat_id, and credentials - For
MESSAGEchannels, set a reachablecallback_url - Save — the channel detail page shows the webhook URL
Webhook pattern:
{PUBLIC_WEBHOOK_URL}/webhooks/{organization_id}/{platform}/{channel_id}Create a prompt in the UI
- Go to Prompts → New prompt
- Pick a
PROMPTchannel - Enter text and optional button options
- Optionally set
callback_url, TTL, and allow free-text replies
Send a message in the UI
- Go to Messages → Send message (or use Send message on a MESSAGE channel)
- Pick a
MESSAGEchannel - Enter text and submit
Inbound chat on MESSAGE channels is also stored automatically. See Messages.
Data retention
Under Settings → Data retention:
Scheduled deletion — enable separately for prompts, inbound messages, and outbound messages; each has its own day count when enabled.
Do not store — skip persisting inbound or outbound messages entirely (zero retention).
Defaults: prompts scheduled deletion off; inbound and outbound scheduled deletion on for 30 days; zero retention off for both directions.
Required env vars for the UI
| Variable | Purpose |
|---|---|
DATABASE_URL | Same Postgres as core (admin users table) |
GREENLIGHT_API_URL | Core base URL (default http://localhost:8100) |
GREENLIGHT_API_KEY | Calls core API (X-API-Key) — admin-scoped key (bootstrap or from Settings) |
AUTH_SECRET | NextAuth sessions |
For hybrid npm run dev, set GREENLIGHT_API_KEY in the root .env. Core and UI use the same value.
See Configuration for the full list.
API-only deployments
You can omit the UI entirely. See API-only mode.