Search

Results include substring matches and semantically similar vals. Learn more
rodrigotello avatar
valTownInspoList
@rodrigotello
Val Town inspiration & use cases list List [as object] used in Val Town's use cases and inspiration. Check it out at in /examples/use-cases and /docs/tutorial/4
Script
"https://air-prod.imgix.net/abff23bf-fc18-485f-a6b5-4a1c8b7f91ec.jpg?w=1200&h=2000&auto=compress&ixlib=react-9.5.4",
"https://air-prod.imgix.net/11ab8b2e-c052-4574-8341-96d5d74040cc.jpg?w=1200&h=2000&auto=compress&ixlib=react-9.5.4",
"https://air-prod.imgix.net/61e08fed-c77e-4a7b-9ae5-1efabb349574.jpg?w=1200&h=2000&auto=compress&ixlib=react-9.5.4",
"https://air-prod.imgix.net/3545d2cb-7cae-49d9-98b7-832428d2af34.jpg?w=1200&h=2000&auto=compress&ixlib=react-9.5.4",
"https://air-prod.imgix.net/4c81af31-0832-4c72-8afb-34ef23fa03c9.jpg?w=1200&h=2000&auto=compress&ixlib=react-9.5.4",
"https://air-prod.imgix.net/1a21321c-2bb7-4aa8-8c26-eb58cf1787a2.jpg?w=1200&h=2000&auto=compress&ixlib=react-9.5.4",
"https://air-prod.imgix.net/d21d3c1f-99e9-4356-85ed-bc6d7746c867.jpg?w=1200&h=2000&auto=compress&ixlib=react-9.5.4",
"https://air-prod.imgix.net/cab68838-bc60-48a2-8b00-50f203ac303d.jpg?w=1200&h=2000&auto=compress&ixlib=react-9.5.4",
"https://air-prod.imgix.net/0d6605d2-b3ab-4bcb-9cf4-06580c5007ee.jpg?w=1200&h=2000&auto=compress&ixlib=react-9.5.4",
"https://air-prod.imgix.net/9ad2b03e-ea41-4402-b18d-50df75f29d5e.jpg?w=1200&h=2000&auto=compress&ixlib=react-9.5.4",
ifavo avatar
vechain_sdk_blocks_best_http
@ifavo
An interactive, runnable TypeScript val by ifavo
HTTP (deprecated)
import { HttpClient, ThorClient } from "npm:@vechain/sdk-network";
const thor = new ThorClient(new HttpClient("https://mainnet.vechain.org"));
export const httpAction = async () => {
const bestBlock = await thor.blocks.getBestBlockCompressed();
ashryanio avatar
openAiProxy
@ashryanio
openAiProxy Overview This val is a proxy server that interacts with the OpenAI API to generate responses based on prompts in the request body. The function handles incoming HTTP POST requests, processes the prompt, and returns a response generated by the LLM. Prerequisites Server-side: (Optional) An active OpenAI API key Client-side: Something that can make POST requests (browser code, Postman, cURL, another Val, etc) Usage Endpoint The primary endpoint for this function is designed to handle HTTP POST requests. Request Method : POST Content-Type : application/json Body : JSON object containing a prompt field (e.g. {"prompt": "Help me make a boat."} ) Example Request curl -X POST https://ashryanio-openaiproxy.web.val.run -H "Content-Type: application/json" -d '{"prompt": "Hello, OpenAI!"}' Response Content-Type : application/json Body : JSON object containing the response from the OpenAI language model. Example Response { "llmResponse": "Hi there! How can I assist you today?" } Error Handling 400 Bad Request : Returned if the prompt field is missing in the request body. 405 Method Not Allowed : Returned if any method other than POST or OPTIONS is used. 500 Internal Server Error : Returned if there is an error processing the request.
HTTP (deprecated)
## Prerequisites
- Server-side: (Optional) An active OpenAI API key
- Client-side: Something that can make POST requests (browser code, Postman, cURL, another Val, etc)
## Usage
kora avatar
turso
@kora
// console.log(await turso.execute("SELECT * FROM users"));
Script
import process from "node:process";
import { createClient } from "npm:@libsql/client";
export let turso = createClient({
url: process.env.TURSO_DATABASE_URL,
authToken: process.env.TURSO_AUTH_TOKEN,
boson avatar
discordWebhookWeatherHyd
@boson
Grabs daily accuweather report for a city and pushes concise result into discord webhook
Cron
output += `Night will be ${minTempPhrase.toLowerCase()} with a low of **${minTemp}°C**.`;
// Push result to webhook
// Hyderabad Discord Server : community servers search inside discord
export const discordWebhookWeatherHyd = discordWebhook({
url: process.env.HydGenHook,
pomdtr avatar
pwa
@pomdtr
Add a pwa manifest to an http val (to open in as an app in iOS). See https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps for available fields. Usage import handler from "https://esm.town/v/maxm/staticChess"; import { pwa } from "https://esm.town/v/pomdtr/pwa"; export default pwa(handler, { name: "Static Chess", display: "standalone", background_color: "#ffffff", start_url: "/", });
Script
launch_handler?: {
client_mode: LaunchHandlerClientMode | LaunchHandlerClientMode[]
learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/sidebar#enable-sidebar-support-in-your-pwa
edge_side_panel?: {
preferred_width?: number
* @see https://developer.mozilla.org/en-US/docs/Web/Manifest/launch_handler#launch_handler_item_values
export type LaunchHandlerClientMode = 'auto' | 'focus-existing' | 'navigate-existing' | 'navigate-new'
export type Display = 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser'
nbbaier avatar
vtIdeaList
@nbbaier
Vals I Want to Build A running list of things I want to build on Val Town, hosted in a Val Town readme . [ ] A bare bones CMS to edit markdown files hosted on a github (or val town readmes eventually) [ ] A set of Vals for interacting with github repos via Octokit (useful for the above CMS idea) [ ] A full json-server like implementation for quickly generating stub APIs based on json/valtown blob data ( begun ) [ ] An implementation of Convert bookmarklet to Chrome extension [ ] A tool for generating an NPM package from a Val or set of Vals (something like [dnt]- [ ] (https://github.com/denoland/dnt/)) [ ] An email handler for forwarding emails to Tana [ ] A component library (this would be a wild swing for me) [ ] A val to get a dependency graph of a val(s) ( started here by rlesser ) [ ] A single val that wraps a FeTS client to the API for saving a couple of lines of boilerplate [ ] A val for generating OpenAPI specs from jsdoc comments within vals (sort of like this npm package ) [ ] Conways game of life pst, if you want to see stuff I would love to see built right into Val Town, here you go
HTTP
- [ ] A val to get a dependency graph of a val(s) ([started here](https://www.val.town/v/rlesser/dependency_graph) by [rlesse
- [ ] A single val that wraps a [FeTS client](https://the-guild.dev/openapi/fets) to the API for saving a couple of lines of
- [ ] A val for generating OpenAPI specs from jsdoc comments within vals (sort of like [this npm package](https://www.npmjs.c
dglazkov avatar
servicefactory
@dglazkov
A helper to create an HTTP endpoint that conforms to the Breadboard Service Endpoint (BSE) protocol. See https://www.val.town/v/dglazkov/googlenews for sample usage. For more information, see Breadboard service node .
Script
* Indicates that the output node should bubble up to the invoking runner,
* if any.
* This is useful for sending outputs to the user from inside of the nested
* graphs.
| "bubble"
karkowg avatar
fav
@karkowg
fav Turn an emoji into an SVG favicon. Inspired by Lea's tweet . Usage <link rel="icon" href="https://karkowg-fav.web.val.run?emoji=🧨" /> Alternatively, you can use Wes Bos' fav.farm .
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/preact */
import { isEmoji } from "https://esm.town/v/karkowg/emojis";
import { html } from "https://esm.town/v/stevekrouse/html?v=5";
import { render } from "npm:preact-render-to-string";
function FavIcon({ emoji }: { emoji: string }) {
return (
zzz avatar
RateLimitDemo
@zzz
// https://api.val.town/v1/express/zzz.RateLimitDemo
Script
// https://api.val.town/v1/express/zzz.RateLimitDemo
export async function RateLimitDemo(req, res) {
const ip = req.get("true-client-ip") ??
req.get("x-forwarded-for")?.split(",")[0];
// const user = $zzz.whoami();
jacoblee93 avatar
conversationalQAChainEx
@jacoblee93
An interactive, runnable TypeScript val by jacoblee93
Script
llm: gpt35, // Need for speed!
const chatHistory = [];
const query = `What did the president say about Ketanji Brown Jackson?`;
const response = await qaChain;
console.log("response");
akalanala avatar
fuchsiaMosquito
@akalanala
An interactive, runnable TypeScript val by akalanala
HTTP (deprecated)
import { SMTPClient } from "https://deno.land/x/denomailer@1.6.0/mod.ts";
import { z } from "https://deno.land/x/zod@v3.23.8/mod.ts";
status: 500,
const client = new SMTPClient({
connection: {
from: user,
await client.send(sendCfg);
await client.close();
return Response.json({ ok: true });
git avatar
unionTypeScriptSDK
@git
Union TypeScript SDK Example Usage import { http } from "viem"; import { privateKeyToAccount } from "viem/accounts"; import { createUnionClient, hexStringToUint8Array } from "@union/client"; const PRIVATE_KEY = process.env.PRIVATE_KEY; const account = privateKeyToAccount(`0x${PRIVATE_KEY}`); const client = createUnionClient({ account, chainId: "80084", transport: http("https://bartio.rpc.berachain.com"), }); const transfer = await client.transferAsset({ amount: 1n, autoApprove: true, destinationChainId: "stride-internal-1", recipient: "stride14qemq0vw6y3gc3u3e0aty2e764u4gs5l66hpe3", denomAddress: "0x0E4aaF1351de4c0264C5c7056Ef3777b41BD8e03", // HONEY }); if (transfer.isErr()) { console.error("Transfer failed", transfer.error); } console.info("Transfer successful", transfer.value);
Script
import { privateKeyToAccount } from "viem/accounts";
import { createUnionClient, hexStringToUint8Array } from "@union/client";
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const account = privateKeyToAccount(`0x${PRIVATE_KEY}`);
const client = createUnionClient({
account,
transport: http("https://bartio.rpc.berachain.com"),
const transfer = await client.transferAsset({
amount: 1n,
import { createUnionClient } from "jsr:@union/client";
import { http } from "npm:viem";
const account = privateKeyToAccount(`0x${PRIVATE_KEY}`);
const client = createUnionClient({
account,
transport: http("https://bartio.rpc.berachain.com"),
const transfer = await client.transferAsset({
amount: 1n,
geoffreylitt avatar
watcher
@geoffreylitt
set up Automerge's internal wasm guts manually
Cron
import { discordWebhook } from "https://esm.town/v/pvh/discordWebhook";
import { BrowserWebSocketClientAdapter } from "npm:@automerge/automerge-repo-network-websocket";
import { isValidAutomergeUrl, Repo } from "npm:@automerge/automerge-repo/slim";
/* set up Automerge's internal wasm guts manually */
await automerge.next.initializeBase64Wasm(automergeWasmBase64);
export default async function() {
const repo = new Repo({ network: [new BrowserWebSocketClientAdapter("wss://sync.automerge.org")] });
const listHandle = repo.find("3NUkYztG95r7cc8uvmyGgW7KkK9j");
const listDoc = await listHandle.doc();
stevekrouse avatar
spotifyClientId
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export let spotifyClientId = "594b06255b0d469a83b8755372859b22"