Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix: update admin key retrieval to prioritize database configuration; mark subproject as dirty

nirholas0984bd33cecc
diff --git a/api/chat/config.js b/api/chat/config.js
index 71653eb8d..09cc84e9e 100644
--- a/api/chat/config.js
+++ b/api/chat/config.js
@@ -48,9 +48,10 @@ export default wrap(async (req, res) => {
return json(res, 200, { data: row ?? DEFAULTS });
}
- // POST — admin key required
- const adminKey = env.CHAT_ADMIN_KEY;
- if (!adminKey) return error(res, 503, 'not_configured', 'CHAT_ADMIN_KEY is not set');
+ // POST — admin key required (DB row takes precedence over env var, enabling keyless redeploy)
+ const [configRow] = await sql`SELECT admin_key FROM chat_brand_config WHERE key = 'global'`;
+ const adminKey = configRow?.admin_key || env.CHAT_ADMIN_KEY;
+ if (!adminKey) return error(res, 503, 'not_configured', 'Admin key is not configured');
const provided = (req.headers['x-admin-key'] || '').trim();
if (!provided || provided !== adminKey)