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

nbbaier

codesearch

Public
Like
1
codesearch
Home
Code
4
backend
2
frontend
3
shared
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
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
10/18/2025
README.md

Val Town Code Search

A web application for searching through your Val Town vals using the Val Town API.

Features

  • Search through all your vals by name, content, or description
  • Filter by val type (HTTP, cron, email, script)
  • View val details including code content
  • Direct links to edit vals in Val Town
  • Real-time search with debouncing
  • Responsive design with TailwindCSS

Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ index.ts             # Main Hono server
β”‚   └── routes/
β”‚       └── api.ts           # Val Town API integration
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html           # Main HTML template
β”‚   β”œβ”€β”€ index.tsx            # React frontend entry point
β”‚   └── components/
β”‚       β”œβ”€β”€ App.tsx          # Main app component
β”‚       β”œβ”€β”€ SearchBar.tsx    # Search input component
β”‚       β”œβ”€β”€ ValCard.tsx      # Individual val display
β”‚       └── FilterBar.tsx    # Type filters
└── shared/
    └── types.ts             # Shared TypeScript types

Setup

  1. Get your Val Town API token:

    • Go to Val Town API Settings
    • Create a new API token with the following scopes:
      • vals:read - Required to read your vals and their content
      • user:read - Required to access your user information and vals list
    • Copy the token
  2. Set the environment variable:

    • In your Val Town project, set VALTOWN_API_TOKEN to your API token
    • The app will automatically detect when the token is available
  3. Access the app:

    • The app will be available at your HTTP endpoint
    • If the token isn't set, you'll see instructions on the homepage

Required API Scopes

The application requires the following Val Town API scopes:

  • vals:read - Allows reading your vals, their code content, metadata, and search functionality
  • user:read - Allows accessing your user profile and listing your vals

These scopes provide read-only access to your vals and are necessary for the search functionality to work properly.

API Endpoints

  • GET / - Serves the main application
  • GET /api/vals - Search vals with query parameters:
    • q - Search query (optional)
    • type - Filter by val type (optional)
    • limit - Number of results (default: 50)
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
Β© 2025 Val Town, Inc.