Paperclip API Auth
Quick Context
The heartbeat runner does not currently inject PAPERCLIP_API_KEY into the agent environment. Workaround: create an API key directly in the agent_api_keys Postgres table.
Workaround Steps
- Connect to DB:
postgres://paperclip:<pw>@paperclip-db:5432/paperclip - Generate raw key:
crypto.randomBytes(32).toString('hex') - Hash it:
crypto.createHash('sha256').update(rawKey).digest('hex') - Insert:
INSERT INTO agent_api_keys (id, agent_id, company_id, name, key_hash, created_at) VALUES (...) - Use raw key as Bearer token.
Use NODE_PATH=/tmp/.npm/_npx/43414d9b790239bb/node_modules to access pg module.