• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
project logo

whp

GitHub-To-Clay

Scrape users from any GitHub repo, and ingest into Clay
Public
Like
GitHub-To-Clay
Home
Code
7
AGENTS.md
README.md
clay.ts
config.ts
database.ts
github.ts
C
main.ts
Branches
2
Pull requests
Remixes
History
Environment variables
1
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.
Sign up now
Code
/
Code
/
Search
README.md

GitHub to Clay Scraper

CleanShot_2025-10-08_at_17.41.422x.png Automatically ingest GitHub accounts of everyone who interacts with your repo into Clay.

This val tracks anyone who:

  • Created an issue
  • Reacted to an issue
  • Commented on an issue
  • Reacted to an issue's comments
  • Starred a repo
  • Forked a repo

Setup

  1. Click Remix on the top-right to get a copy of it

  2. Set up a Clay workbook with a Webhook column

  3. Copy your Clay workbook's Webhook URL CleanShot 2025-08-08 at 13.23.47@2x.png

  4. Set that as CLAY_WEBHOOK_URL in this val's Environment variables on the left sidebar

  5. In config.ts, replace GITHUB_REPO with the full repository name (format: "owner/repo")

  6. And that's it! The cron will run on your repo every 30 minutes from now on. To test it out immediately, navigate to main.ts and click Run.

Files

  • config.ts - Configuration settings for the scraper
  • database.ts - SQLite database for tracking sent users
  • clay.ts - Send data to Clay
  • github.ts - Collects engaged users and fetches usernames
  • main.ts - Cron trigger that orchestrates the scraping and Clay integration

User Deduplication

This scraper automatically tracks which users have been sent to Clay to prevent duplicates. The feature is controlled by the ENABLE_DEDUPLICATION flag in config.ts (enabled by default).

How it works:

  • Users are stored in a SQLite database after being successfully sent to Clay
  • On subsequent runs, the scraper checks the database and only sends new users
  • The database persists across all cron runs, so users are only sent once
  • Each user is tracked by their GitHub username and source repository

Database details:

  • Users are tracked in the tracked_users table
  • Stores: username, source repo, and timestamp of first encounter
  • The database automatically initializes on the first run

To disable deduplication: Set ENABLE_DEDUPLICATION = false in config.ts to send all engaged users on every run (useful for testing or if you want to manage deduplication in Clay instead).

Rate Limiting

On larger repos, you may get rate-limited by GitHub. To mitigate this, Val Town uses a proxied fetch that reroutes requests using a proxy vendor so that requests obtain different IP addresses. It also automatically retries failed requests several times. Note that Note that using std/fetch will be significantly slower than directly calling the Javascript Fetch API due to extra network hops.

Cron
  • main.ts
Code
AGENTS.mdREADME.mdclay.tsconfig.tsdatabase.tsgithub.ts
C
main.ts
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.