Unlisted
Like
github-leads-with-import
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
main.ts
https://dcm31--019bc311574173cfa4dc4e33d37c0fb5.web.val.run
Find potential customers from GitHub activity. Monitor your org's repos for stars, forks, issues, and PRs — then use AI to qualify leads automatically.
- A cron job monitors public activity on your GitHub org
- When someone stars, forks, or opens an issue/PR, they're captured
- An AI agent researches the person and scores them as a lead
- Qualified leads appear in your dashboard with periodic digest emails
- Import/Export — Migrate leads between instances or from multi-company exports
- Click Remix
- Add environment variables:
OPENAI_API_KEY— for AI lead qualificationGITHUB_TOKEN— for accessing GitHub API (create one here)
- Configure your settings:
- Edit
GITHUB_ORGingithub.cron.ts - Edit
RECIPIENTSindigest.ts - Customize
PROMPT.txtwith your ICP criteria
- Edit
- Open
main.tsto view your dashboard
Note: GitHub's Events API only returns the 300 most recent events per org.
This val supports importing and exporting lead data, making it easy to migrate leads when you remix the val or share data between instances.
- Dashboard: Click "Export All Leads" to download a JSON file
- API:
GET /exportreturns all leads as JSON
- Dashboard: Use the "Import Leads" panel to upload a JSON file or fetch from a URL
- API:
POST /import— Import from JSON bodyPOST /import-from-url— Import from a remote URL (e.g., multi-company export)
This val can import from:
- Its own export format (
GET /export) - The multi-company GitHub leads val (
GET /c/{slug}/export)
Duplicates are automatically skipped based on GitHub username or email.
# Export from multi-company val, import here curl -X POST "https://your-val.val.run/import-from-url" \ -H "Content-Type: application/json" \ -d '{"url": "https://dcm31--github-leads-multi-company.web.val.run/c/company-slug/export"}'
GitHub Monitoring (github.cron.ts)
- Runs hourly to check for new activity on your org
- Captures stars, forks, issues, PRs, and other public events
- Groups events by user to avoid duplicate leads
AI Agent (agent.ts)
- Researches each GitHub user's profile, repos, and linked sites
- Uses web search to learn about their company and role
- Scores them against your ICP defined in
PROMPT.txt - Returns
{name, match, score, leadTypes, reasoning}
Storage (db.ts)
- Every lead is stored in SQLite with columns:
id— auto-incrementedtimestamp— when first seeninput_data— the GitHub event(s) that triggered itoutput_data— AI result
Dashboard (main.ts)
- Qualified leads (match=true) appear at the top
- Shows score and lead type tags (customer/hire)
- Click a lead to see full details and GitHub activity
Email Digest (digest.ts)
- Sends daily emails (1pm UTC) with new qualified leads
- Edit
RECIPIENTSarray to configure who receives them
- Edit
PROMPT.txtto define your ideal customer profile - Adjust the GitHub sweep frequency in
github.cron.tsinterval settings (default: hourly) - Adjust the email digest schedule in
digest.tsinterval settings (default: daily at 1pm UTC)
Use the test bar in the dashboard to evaluate any GitHub username instantly.
| Endpoint | Method | Description |
|---|---|---|
/ | GET | Dashboard |
/ | POST | Webhook to add leads |
/export | GET | Download all leads as JSON |
/import | POST | Import leads from JSON body |
/import-from-url | POST | Import from remote URL |
/clear?confirm=yes | POST | Delete all leads (use with caution) |
/lead/:id | GET | View single lead |
/lead/:id/reanalyze | POST | Re-run AI analysis on a lead |