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/$%7BsvgDataUrl%7D?q=function&page=2&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 30501 results for "function"(2274ms)

Email268 words

https://docs.val.town/vals/email/
team emails to Discord / Slack. Tip. Vals can send email, too! Using the email function in the standard library. Type Signature. Section titled “Type Signature” Files triggered by Email

Sections

Email

team emails to Discord / Slack. Tip. Vals can send email, too! Using the email function in the standard library.

Type Signature

Type Signature. Section titled “Type Signature” Files triggered by Email receive an argument called Email that represents the email that was sent. Here’s an example: Example export async function emailValHandler(email:

Send Discord message via webhook129 words

https://docs.val.town/integrations/discord/send-message/
body: JSON.stringify({ content }), }); if (text.length) throw Error("Discord Webhook error: " + text); }; You can browse example usages of this function here. Example Integration. Section titled “Example Integration”

Sections

Send Discord message via webhook

throw Error("Discord Webhook error: " + text); }; You can browse example usages of this function here.

Receiving a GitHub Webhook369 words

https://docs.val.town/integrations/github/receiving-a-github-webhook/
of your webhook. Securing GitHub Webhooks. Section titled “Securing GitHub Webhooks” Once public, your val function will listen for any payload sent to its endpoint. For security reasons, you probably

Sections

Securing GitHub Webhooks

GitHub Webhooks” Once public, your val function will listen for any payload sent to its endpoint. For security reasons, you probably want to limit requests to those coming from GitHub.

RSS153 words

https://docs.val.town/guides/rss/
"https://esm.town/v/std/email?v=9"; import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems"; import { rssFeeds } from "https://esm.town/v/stevekrouse/rssFeeds"; export async function pollRSSFeeds({ lastRunAt }: Interval) { return Promise.all( Object.entries(rssFeeds).map(async ([name, url]) => { let items

Sections

Polling RSS

"https://esm.town/v/std/email?v=9"; import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems"; import { rssFeeds } from "https://esm.town/v/stevekrouse/rssFeeds"; export async function pollRSSFeeds({ lastRunAt }: Interval) { return Promise.all( Object.entries(rssFeeds).map(async ([name, url]) => { let items

ORMs206 words

https://docs.val.town/std/sqlite/orms/
Prisma. Section titled “Prisma” 🚫 Prisma isn’t supported in Val Town because it relies on functionality that only exists in a classic server environment. Sequelize. Section titled “Sequelize” 🚫 Sequelize

Sections

Prisma

Prisma. Section titled “Prisma” 🚫 Prisma isn’t supported in Val Town because it relies on functionality that only exists in a classic server environment.

Importing674 words

https://docs.val.town/reference/import/
mind, and won’t work with Deno. While Deno implements most of the functionality of Node.js and some of the functionality of browsers - so many modules will “just work” in

Sections

Look for Deno compatibility

mind, and won’t work with Deno. While Deno implements most of the functionality of Node.js and some of the functionality of browsers - so many modules will “just work” in

Stripe741 words

https://docs.val.town/integrations/stripe/
@ts-ignore. import { Stripe } from "npm:stripe"; const stripe = new Stripe(Deno.env.get("STRIPE_TEST_API_KEY")); export default async function (req: Request): Promise<Response> { const url = new URL(req.url); if (url.pathname === "/") {

Sections

Stripe Checkout

@ts-ignore. import { Stripe } from "npm:stripe"; const stripe = new Stripe(Deno.env.get("STRIPE_TEST_API_KEY")); export default async function (req: Request): Promise<Response> { const url = new URL(req.url); if (url.pathname === "/") {

Example Val Town Stripe Webhook

from "npm:stripe"; const stripe = new Stripe( Deno.env.get("stripe_sk_customer_readonly") as string, { apiVersion: "2020-08-27", } ); function getStripeCustomer(customerId: string) { return stripe.customers.retrieve(customerId); } export let newStripeEvent = async (req: Request) =>

Permission errors345 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

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,

Upgrade Guide: Safer Val Scopes378 words

https://docs.val.town/troubleshooting/std-set-permission-error/
is deprecated and we now use blob storage with our std/blob library instead. The equivalent function to std.set() is blob.setJSON(). // Using std/set. import { set } from "https://esm.town/v/std/set"; set("createdAt",

Sections

Use Blob Storage Instead (recommended)

Use Blob Storage Instead (recommended). Section titled “Use Blob Storage Instead (recommended)” Std/set is deprecated and we now use blob storage with our std/blob library instead. The equivalent function to

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

anchorPDSREADME.md4 matches

@tijs•Updated 1 hour ago
8test/
9├── auth.test.ts # Authentication and token validation tests
10├── validation.test.ts # Input validation and utility function tests
11├── database.test.ts # Database schema and query logic tests
12├── integration.test.ts # End-to-end API endpoint tests
55- Geographic coordinate validation
56- Timestamp format validation
57- Utility function testing (UUID generation, URI formatting)
58
59### 🗄️ Database Tests (`database.test.ts`)
76The test suite covers:
77
78âś… **Core Functionality**
79
80- Record validation and creation
146## Adding New Tests
147
148When adding new functionality, ensure tests cover:
149
1501. **Happy Path**: Normal operation with valid inputs

anchorPDSanchor_pds_implementation_plan.md3 matches

@tijs•Updated 1 hour ago
5## Overview
6
7We'll build a lightweight PDS focused on `app.dropanchor.checkin` records using TypeScript + SQLite, with three main phases of functionality.
8
9## Phase 1: Core Check-In Storage and Feeds
19
20**Implementation Steps:**
211. Create authentication middleware function
222. Parse Authorization header and extract token
233. Call user's home PDS to validate token and get DID
265- **Rationale:** Works regardless of feed post settings, provides consistent experience
266
267This implementation plan prioritizes working functionality over optimization, allowing for iterative improvements as usage patterns emerge.
268
269## Additional Resources
tuna

tuna9 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.