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/image-url.jpg?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 27947 results for "function"(799ms)

Express410 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

Blob Storage414 words

https://docs.val.town/std/blob/
ValTownBlobError for unexpected errors. Utilities. Section titled “Utilities” Our Blob SDK also includes some utility functions to make working with blobs easier. Copy. Section titled “Copy” Copy import { blob

Sections

Utilities

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

JavaScript SDK427 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 S3483 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 Vals513 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 bot584 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. Section titled “1. Create your bot” Telegram has the best

Sections

Introduction

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

Google Sheets1356 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 bot692 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

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

Permissions935 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")

TownieuseLoadingFavicon.ts3 matches

@zeinab13•Updated 1 hour ago
1import { useEffect } from "react";
2
3function setLoadingFavicon() {
4 document.querySelector('link[rel="icon"]').href = "/favicon-loading.svg";
5}
6function resetFavicon() {
7 document.querySelector('link[rel="icon"]').href = "/favicon.svg";
8}
9
10export function useLoadingFavicon(loading: boolean) {
11 useEffect(() => {
12 if (loading) setLoadingFavicon();

TownieuseCreateProject.tsx1 match

@zeinab13•Updated 1 hour ago
3const ENDPOINT = "/api/create-project";
4
5export function useCreateProject() {
6 const [data, setData] = useState<any>(null);
7 const [loading, setLoading] = useState(false);

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.