SDK Reference
API & Integration Docs
Integrate LeadForge database tables with external scripting tasks or export custom CSV mappings locally.
Direct SQLite Queries (Node.js)
Because LeadForge OS saves CRM pipelines in simple SQLite databases, you can connect directly to your local file and run custom SQL scripts.
import Database from 'better-sqlite3';
const db = new Database('~/.config/leadforge/workspace.db');
// Fetch hot leads with verified emails
const hotLeads = db.prepare(
"SELECT name, domain, emails FROM leads WHERE score >= 75"
).all();
console.log(hotLeads);
const db = new Database('~/.config/leadforge/workspace.db');
// Fetch hot leads with verified emails
const hotLeads = db.prepare(
"SELECT name, domain, emails FROM leads WHERE score >= 75"
).all();
console.log(hotLeads);
leads Table Schema
- `id` (TEXT, Primary Key)
- `name` (TEXT, Company name)
- `domain` (TEXT, Company domain)
- `score` (INTEGER, Fit formula outcome)
- `emails` (TEXT, JSON array of contacts)
campaigns Table Schema
- `id` (TEXT, Primary Key)
- `sender_id` (TEXT, SMTP relayer reference)
- `status` (TEXT, active/paused/completed)
- `schedule` (TEXT, Cron-like execution timing)