Github API examples & templates
Use these vals as a playground to view and fork Github API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.

pomdtr
freeformServer
Freeform Brings a taste of Observable to Val Town. This val was adapted from @tmcw obsidian plugin . Instead of using the display function, this port use export default . https://pomdtr-freeformServer.web.val.run/v/<author>/<name> or https://freeform.pomdtr.me/v/<author>/<name> Examples Bar Chart ( View Source )
HTTP
tmcw
happyDomExample
happy-dom Happy-dom is a module that provides a DOM-like abstraction that's pretty popular for test frameworks and server-side rendering, because it's a lot faster and lighter than more full-fledged browser-like options. By default, happy-dom doesn't support Deno , which is the basis for Val Town's runtime, but there's a fork that conveniently swaps out the thing it doesn't support, which is the Node.js vm module. Another way to work with the DOM is to use domino .
Script

saolsen
example_rust_val
This val is written in Rust! See This Gist for how to build rust vals.
And https://www.val.town/v/saolsen/use_example_rust_val for an example of how to use it.
Script

pomdtr
val2img
This val is supposed to be used with the val.town extension. See the extension readme for installation instructions.
Script
maxm
bloomingButton
Add a blooming emoji effect when a button is clicked. Import this val as a module and add the bloom-button class to your button. Demo here: https://www.val.town/v/maxm/bloomingButtonDemo /** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request): Promise<Response> {
return new Response(
renderToString(
<>
<link rel="stylesheet" href="https://jenil.github.io/bulmaswatch/simplex/bulmaswatch.min.css" />
<div style={{ textAlign: "center", marginTop: "100px" }}>
<button className="is-success button bloom-button" id="treeButton">Click Me</button>
</div>
<script type="module" src="https://esm.town/v/maxm/bloomingButton" />
</>,
),
{ headers: { "content-type": "text/html" } },
);
}
Script
nerdymomocat
add_to_notion_w_ai_webpage
Example usage of the add_to_notion_w_ai val Try with the money database . Read and watch the demo run here
HTTP
curtcox
slides
Use the tail of the path to specify the slideshow URL. Use the left and right arrow keys to navigate. The slideshow file format is: seconds-to-show URL-to-show Here's a set of example slides. https://curtcox-slides.web.val.run/raw.githubusercontent.com/curtcox/slides/refs/heads/main/sets/ai The tail of the URL points to the plain text slide list at https://raw.githubusercontent.com/curtcox/slides/refs/heads/main/sets/ai If your slides are blocked due to the domain, you could serve them somewhere besides val.town.
An easy way to do that while still using a github repo is to embed the slides directly into an HTML page.
You could use Github Pages or https://raw.githack.com/ to serve that.
HTTP
fgeierst
AriaSnapshotFromUrl
compare https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/injected/ariaSnapshot.ts
HTTP