• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
flymaster

flymaster

deploy

Public
Like
deploy
Home
Code
2
README.md
H
main.ts
Branches
1
Pull requests
Remixes
History
Environment variables
2
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
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of main branch: v9
View latest version
README.md

Git Repository Webhook

This webhook automatically clones a git repository and updates the "lifehub" val with its contents whenever accessed via HTTP.

Setup

  1. Set the environment variable repo to your GitHub repository URL (HTTPS format):

    repo=https://github.com/username/repository-name
    
  2. The webhook is automatically triggered when this val receives an HTTP request.

How it works

  1. Repository Parsing: Extracts owner and repository name from the GitHub URL
  2. Content Fetching: Uses GitHub's API to recursively fetch all files from the repository
  3. File Processing: Downloads and processes each file, converting them to Val Town format
  4. Lifehub Update: Generates code for the "lifehub" val containing all repository content

API Response

Success Response

{ "success": true, "message": "Successfully updated lifehub val with X files from owner/repo", "files": ["file1.js", "file2.md", ...] }

Error Response

{ "error": "Error description", "details": "Detailed error message" }

Lifehub Val Features

The generated lifehub val will include:

  • File Access: Get specific files via ?file=filename query parameter
  • File Listing: GET request without parameters returns all files and metadata
  • Helper Functions:
    • getFile(filename): Get content of a specific file
    • listFiles(): Get array of all file names

Usage Examples

Trigger the webhook

curl https://your-val-url.web.val.run

Access lifehub content

# Get file list curl https://lifehub-val-url.web.val.run # Get specific file curl https://lifehub-val-url.web.val.run?file=README_md

Limitations

  • Only processes text files (binary files are skipped)
  • File names are sanitized for Val Town compatibility
  • Large repositories may take time to process
  • Currently logs the generated code (actual Val Town API integration needed)

Environment Variables Required

  • repo: GitHub repository URL in HTTPS format

Security Notes

  • Generated vals are set to "unlisted" privacy by default
  • No authentication required for webhook trigger (add if needed)
  • Repository must be public or accessible via the provided URL
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.