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

  1. Connect to DB: postgres://paperclip:<pw>@paperclip-db:5432/paperclip
  2. Generate raw key: crypto.randomBytes(32).toString('hex')
  3. Hash it: crypto.createHash('sha256').update(rawKey).digest('hex')
  4. Insert: INSERT INTO agent_api_keys (id, agent_id, company_id, name, key_hash, created_at) VALUES (...)
  5. Use raw key as Bearer token.

Use NODE_PATH=/tmp/.npm/_npx/43414d9b790239bb/node_modules to access pg module.