Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bsuccess?q=function&page=3&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 18026 results for "function"(735ms)

Permission errors334 words

https://docs.val.town/troubleshooting/permission-errors/
to your secrets (--allow-env). Some system information (--allow-sys=osRelease,homedir,cpus,hostname) This allows you to access the following functionality: import os from "node:os"; os.cpus(); os.homedir(); Deno.osRelease(); Deno.hostname(); These values are not particularly useful,

Sections

Allowed permissions

Allowed permissions. Vals have the following permissions: Network access (--allow-net). Environment access, limited to your secrets (--allow-env). Some system information (--allow-sys=osRelease,homedir,cpus,hostname) This allows you to access the following functionality: import

Blob Storage366 words

https://docs.val.town/std/blob/
method can throw ValTownBlobError for unexpected errors. Utilities. Our Blob SDK also includes some utility functions to make working with blobs easier. Copy. Copy import { blob } from "https://esm.town/v/std/blob";

Sections

Utilities

Utilities. Our Blob SDK also includes some utility functions to make working with blobs easier.

Express402 words

https://docs.val.town/legacy-vals/express/
webhook handler to adhere to another service’s specifications (example val). The Val must be a function. It is passed two arguments, the Express req and res objects. You can use

Sections

Express

webhook handler to adhere to another service’s specifications (example val). The Val must be a function. It is passed two arguments, the Express req and res objects. You can use

JavaScript SDK414 words

https://docs.val.town/api/sdk/
to your package.json file. index.mjs import ValTown from "@valtown/sdk"; const valTown = new ValTown(); async function main() { const myProfile = await valTown.me.profile.retrieve(); console.log(myProfile); } main(); Finally, the API expects

Sections

Getting started in Node.js

to your package.json file. index.mjs import ValTown from "@valtown/sdk"; const valTown = new ValTown(); async function main() { const myProfile = await valTown.me.profile.retrieve(); console.log(myProfile); } main(); Finally, the API expects

AWS S3445 words

https://docs.val.town/integrations/s3/
Ask questions about this page. You can upload and download from AWS S3 inside val functions. In this guide, you’ll create an AWS bucket, an IAM user, and then test

Sections

AWS S3

Ask questions about this page. You can upload and download from AWS S3 inside val functions. In this guide, you’ll create an AWS bucket, an IAM user, and then test

Upgrading Legacy Vals461 words

https://docs.val.town/upgrading/legacy-vals/
Here’s how you can handle folders: Do nothing: Upgrade vals individually; they remain separate but functional. Manual consolidation: Upgrade the main val first, then manually copy & paste other vals’

Sections

Legacy Val Folders

Here’s how you can handle folders: Do nothing: Upgrade vals individually; they remain separate but functional. Manual consolidation: Upgrade the main val first, then manually copy & paste other vals’

Telegram bot544 words

https://docs.val.town/integrations/telegram/
of this guide, which makes the HTTP calls to telegram more directly with simpler helper function. 1. Create your bot. Telegram has the best bot-making experience of any messaging platform.

Sections

Introduction

of this guide, which makes the HTTP calls to telegram more directly with simpler helper function.

Google Sheets1211 words

https://docs.val.town/integrations/google-sheets/
ACCOUNT ID HERE>"; const sheetID = "<YOUR SHEET ID HERE>"; const baseURL = `https://sheets.googleapis.com/v4/spreadsheets/${sheetID}/values`; async function fetchAccessToken() { const response = await fetch( `https://api.pipedream.com/v1/accounts/${accountID}?include_credentials=1`, { headers: { Authorization: `Bearer ${Deno.env.get("pipedream_api_key")}`,

Sections

6. Fetch a Google Sheets access token and use it in your val

ACCOUNT ID HERE>"; const sheetID = "<YOUR SHEET ID HERE>"; const baseURL = `https://sheets.googleapis.com/v4/spreadsheets/${sheetID}/values`; async function fetchAccessToken() { const response = await fetch( `https://api.pipedream.com/v1/accounts/${accountID}?include_credentials=1`, { headers: { Authorization: `Bearer ${Deno.env.get("pipedream_api_key")}`,

Discord bot625 words

https://docs.val.town/integrations/discord/how-to-make-a-discord-bot-hosted-24-7-for-free-in-/
is a social website to write, run, and host JavaScript. You can create APIs, scheduled functions, email yourself, and persist small pieces of data — all from the browser and

Sections

Step 3: Login to Val Town

Step 3: Login to Val Town. Val Town is a social website to write, run, and host JavaScript. You can create APIs, scheduled functions, email yourself, and persist small pieces

Permissions899 words

https://docs.val.town/reference/permissions/
Town Discord notification. // Translates one kind of webhook (Clerk) into another (Discord). export async function handleDiscordNewUser(req: express.Request, res) { // check custom auth secret sent from clerk. if (req.get("auth")

Sections

Custom Authentication

Town Discord notification. // Translates one kind of webhook (Clerk) into another (Discord). export async function handleDiscordNewUser(req: express.Request, res) { // check custom auth secret sent from clerk. if (req.get("auth")

pondiversegetCreations1 match

@argmn•Updated 3 hours ago
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 // First, get the row IDs of all rows that are older than 25 hours old
7 const res = await sqlite.execute(`

pondiversegetCreationImage1 match

@argmn•Updated 3 hours ago
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const id = url.searchParams.get("id");

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",