What Is a "val" on Val Town and How Does It Run?
Updated
A val is the basic unit of code on Val Town: a single TypeScript file you save in the browser, which is then deployed to a live URL in about 100ms. You don't configure a build, a server, or a pipeline — saving is deploying. This makes vals a good fit for small, single-purpose tools (webhooks, scheduled jobs, email handlers, quick APIs) rather than large multi-service applications.
The anatomy of a val
Each val is one file in a TypeScript editor with code intelligence (autocomplete, type checking). From the same editor you can:
- Run code — execute it directly and get a URL that serves the result
- Schedule crons — run the val on a recurring schedule
- Receive emails — trigger the val from inbound email
- Use storage — attach a SQLite database and S3 blob storage
Because a val is just a file with a URL, the mental model is closer to "a script that happens to be hosted" than to a deployed service.
How it runs
- You write or paste TypeScript into the editor.
- You save. Val Town deploys the val to the web — the site states this happens in 100ms.
- The val is now reachable at a live URL, and any triggers you've attached (cron schedule, inbound email, HTTP request) will invoke it.
There is no separate deploy step to remember and no environment to provision first. The trade-off is that you're working within Val Town's runtime and storage primitives rather than an arbitrary server configuration.
What this is good for
The site's own examples point at the intended shape of a val:
- Alert a Slack channel when a big deal closes in HubSpot
- Email a daily digest of new enterprise trials
- Build an admin dashboard for a support queue
- Enrich new signups and route them to the right rep
These are all "one file, one job, one URL" tasks. The quoted users describe the same pattern: an MCP Core maintainer at Anthropic says it's easy to put up a quick MCP or API, an OpenAI engineer describes webhook work as "hit save and your code is running in production in literally 2 seconds," and a Google Chrome DevRel lead frames it as a way to host small experiments quickly.
Working with AI agents
Vals can be written with AI assistance, and Val Town exposes an MCP server so agents can connect to it. The homepage lists setup guides for Claude, ChatGPT, Claude Code, Codex, and Cursor, and the tagline is "instant deployments for you & your agents." If your workflow already runs through an agent, this is the path where a val gets created and deployed without you opening the editor yourself.
When a val is the wrong choice
Pick something else if you need long-running processes, custom system dependencies, or a conventional repo-and-CI deployment. A val is optimized for speed of getting a small piece of logic onto a URL — the same property that makes it fast for experiments makes it a poor fit for heavyweight services.
To try it, sign up and create a val in the editor; the first save gives you a live URL to test against.