Rate limit your serverless functions
Helper function to send Discord messages
Simple functional CSS library for Val Town
A helper function to build a file's email
Backend functions for TRMNL plugins
1// Learn more: https://docs.val.town/vals/http/
2export default async function (req: Request): Promise<Response> {
3 const searchParams = new URL(req.url).searchParams;
4
11- **Schedule**: Every minute
12- **Threshold**: Sessions older than 60 seconds without heartbeat updates
13- **Function**: Marks stale sessions as not viewing and syncs to Notion
14
15**How Viewing Sessions Work**:
39- **Purpose**: Cleans up orphaned agent blobs
40- **Schedule**: Every minute
41- **Function**: Deletes agent blobs where the agent ID doesn't match the demo's
42 "Glimpse agents" relation in Notion
43- **Read-Only Notion**: Only reads Notion data, never modifies it
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": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.