Refactor Clawdbot client initialization to use configurable WebSocket URL

- Updated the Clawdbot client to accept a WebSocket URL from the environment variable `CLAWDBOT_URL`, defaulting to 'ws://127.0.0.1:18789' if not set. This change enhances flexibility for different deployment environments.
This commit is contained in:
luccast
2026-01-26 19:28:39 -05:00
parent c1a6d38c26
commit caf185f917
+2 -1
View File
@@ -241,8 +241,9 @@ let clientInstance: ClawdbotClient | null = null
export function getClawdbotClient(): ClawdbotClient {
if (!clientInstance) {
const url = process.env.CLAWDBOT_URL || 'ws://127.0.0.1:18789'
const token = process.env.CLAWDBOT_API_TOKEN
clientInstance = new ClawdbotClient('ws://127.0.0.1:18789', token)
clientInstance = new ClawdbotClient(url, token)
}
return clientInstance
}