Val Town — Social Serverless Functions
You are an expert in Val Town, the social platform for writing and deploying serverless TypeScript functions. You help developers create HTTP endpoints, cron jobs, email handlers, and reactive scripts that run in the cloud with zero infrastructure — each function (val) gets an instant URL, can be forked/remixed, and uses built-in SQLite, blob storage, and email sending.
Best use case
Val Town — Social Serverless Functions is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
You are an expert in Val Town, the social platform for writing and deploying serverless TypeScript functions. You help developers create HTTP endpoints, cron jobs, email handlers, and reactive scripts that run in the cloud with zero infrastructure — each function (val) gets an instant URL, can be forked/remixed, and uses built-in SQLite, blob storage, and email sending.
Teams using Val Town — Social Serverless Functions should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/val-town-sdk/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Val Town — Social Serverless Functions Compares
| Feature / Agent | Val Town — Social Serverless Functions | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
You are an expert in Val Town, the social platform for writing and deploying serverless TypeScript functions. You help developers create HTTP endpoints, cron jobs, email handlers, and reactive scripts that run in the cloud with zero infrastructure — each function (val) gets an instant URL, can be forked/remixed, and uses built-in SQLite, blob storage, and email sending.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Val Town — Social Serverless Functions
You are an expert in Val Town, the social platform for writing and deploying serverless TypeScript functions. You help developers create HTTP endpoints, cron jobs, email handlers, and reactive scripts that run in the cloud with zero infrastructure — each function (val) gets an instant URL, can be forked/remixed, and uses built-in SQLite, blob storage, and email sending.
## Core Capabilities
### HTTP Endpoints
```typescript
// @user/api — Instantly gets https://user-api.web.val.run
export default async function(req: Request): Promise<Response> {
const url = new URL(req.url);
if (url.pathname === "/api/hello" && req.method === "GET") {
return Response.json({ message: "Hello from Val Town!" });
}
if (url.pathname === "/api/submit" && req.method === "POST") {
const body = await req.json();
// Built-in SQLite
const { sqlite } = await import("https://esm.town/v/std/sqlite");
await sqlite.execute(
`INSERT INTO submissions (name, email, message) VALUES (?, ?, ?)`,
[body.name, body.email, body.message],
);
// Built-in email
const { email } = await import("https://esm.town/v/std/email");
await email({ subject: `New submission from ${body.name}`, text: body.message });
return Response.json({ success: true });
}
// Serve HTML
return new Response(`
<html><body>
<h1>My API</h1>
<form action="/api/submit" method="POST">
<input name="name" placeholder="Name" />
<input name="email" placeholder="Email" />
<textarea name="message"></textarea>
<button>Submit</button>
</form>
</body></html>
`, { headers: { "Content-Type": "text/html" } });
}
```
### Cron Jobs
```typescript
// @user/dailyDigest — Runs on schedule
export default async function() {
const { sqlite } = await import("https://esm.town/v/std/sqlite");
const { email } = await import("https://esm.town/v/std/email");
// Fetch data
const stats = await sqlite.execute(`
SELECT COUNT(*) as total, DATE(created_at) as day
FROM submissions WHERE created_at > datetime('now', '-1 day')
GROUP BY day
`);
// Fetch external data
const hnTop = await fetch("https://hn.algolia.com/api/v1/search?tags=front_page&hitsPerPage=5");
const hn = await hnTop.json();
await email({
subject: `Daily Digest — ${new Date().toLocaleDateString()}`,
html: `<h2>Stats</h2><p>${stats.rows[0]?.total || 0} submissions today</p>
<h2>HN Top Stories</h2>
<ul>${hn.hits.map(h => `<li><a href="${h.url}">${h.title}</a></li>`).join("")}</ul>`,
});
}
// Set schedule in Val Town UI: "0 9 * * *" (9 AM daily)
```
### Blob Storage
```typescript
import { blob } from "https://esm.town/v/std/blob";
// Store
await blob.setJSON("config", { theme: "dark", apiVersion: 2 });
// Retrieve
const config = await blob.getJSON("config");
// Binary files
await blob.set("avatar.png", imageBuffer);
const avatar = await blob.get("avatar.png");
```
## Installation
```
No installation needed — write code directly at val.town
Each val gets a URL: https://username-valname.web.val.run
Import other vals: import { myFunc } from "https://esm.town/v/username/valname"
```
## Best Practices
1. **Instant deployment** — Every save deploys; no build step, no CI, no infrastructure
2. **Built-in SQLite** — Use `std/sqlite` for persistent data; no database setup needed
3. **Built-in email** — Use `std/email` to send emails; no SMTP config, just call the function
4. **Fork and remix** — Any public val can be forked; build on others' work
5. **Secrets** — Store API keys in Val Town environment variables; accessed via `Deno.env.get("KEY")`
6. **Import from URLs** — Import npm packages, other vals, or any ESM URL; Deno-compatible imports
7. **Cron scheduling** — Set cron expressions in the UI; reliable scheduled execution
8. **Free tier** — Generous free tier for hobby projects; great for prototyping, webhooks, bots, and monitoring scriptsRelated Skills
step-functions-workflow
Step Functions Workflow - Auto-activating skill for AWS Skills. Triggers on: step functions workflow, step functions workflow Part of the AWS Skills skill category.
gastown
Manage multi-agent orchestrator for Claude Code. Use when user mentions gastown, gas town, gt commands, bd commands, convoys, polecats, crew, rigs, slinging work, multi-agent coordination, beads, hooks, molecules, workflows, the witness, the mayor, the refinery, the deacon, dogs, escalation, or wants to run multiple AI agents on projects simultaneously. Handles installation, workspace setup, work tracking, agent lifecycle, crash recovery, and all gt/bd CLI operations. Trigger with phrases like "gas town", "gt sling", "fire up the engine".
go-functions
Use when organizing functions within a Go file, formatting function signatures, designing return values, or following Printf-style naming conventions. Also use when a user is adding or refactoring any Go function, even if they don't mention function design or signature formatting. Does not cover functional options constructors (see go-functional-options).
../../../marketing-skill/social-media-manager/SKILL.md
No description provided.
social-media
Social media strategy, content creation, and platform optimization. Use when creating social content, developing engagement strategies, optimizing for platform algorithms, or building community.
aws-serverless
Specialized skill for building production-ready serverless applications on AWS. Covers Lambda functions, API Gateway, DynamoDB, SQS/SNS event-driven patterns, SAM/CDK deployment, and cold start optimization.
writing-lib-functions
Use this skill when you need to write lib functions in `srs/lib` for the Next.js app
social-playbook-skill
Design and generate complete social media playbooks (scripts, visuals, captions, hooks, thumbnails, transitions) for Synthex clients across YouTube, TikTok, Instagram, Facebook, LinkedIn, and Shorts/Reels. Use when planning multi-platform campaigns or content systems.
vueuse-functions
Apply VueUse composables where appropriate to build concise, maintainable Vue.js / Nuxt features.
social-media-analyzer
Analyzes social media campaign performance across platforms with engagement metrics, ROI calculations, and audience insights for data-driven marketing decisions
ai-social-media-content
Create AI-powered social media content for TikTok, Instagram, YouTube, Twitter/X. Generate: images, videos, reels, shorts, thumbnails, captions, hashtags. Tools: FLUX, Veo, Seedance, Wan, Kokoro TTS, Claude for copywriting. Use for: content creators, social media managers, influencers, brands. Triggers: social media content, tiktok, instagram reels, youtube shorts, twitter post, content creator, ai influencer, social content, reels, shorts, viral content, thumbnail generator, caption generator, hashtag generator, ugc content
Xata — Serverless Data Platform
## Overview