Vercel API examples & templates
Use these vals as a playground to view and fork Vercel API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
bmitchinson
Send_Errors_to_Email
Send errors to email Get a POST request, send an email with the given subject. Used to suplement console.error , since vercel charges 20 dollars a month to send my logs elsewhere.
Wish there was a cheaper option for error specific alerting native to vercel. Further described on the val itself! https://bmitchinson-tangiblelimecockroach.web.val.run
HTTP
damidina
cheerioScraper
cheerioScraper This val scrapes a website to extract all the URLs from anchor ( <a> ) tags using the cheerio library. Usage import scrapeWebsite from 'val:damidina.cheerioScraper';
const urls = await scrapeWebsite('https://example.com');
console.log(urls);
Script
nicoalbanese
tomatoMinnow
Vercel AI SDK with Val Town! Use the Vercel AI SDK in your Vals. Note : you must add your OpenAI key to your Val Town Env variables under OPENAI_API_KEY . If you would like to specify a different name for your API Key, you can create a custom OpenAI provider with the createOpenAI function. Prefer another AI provider? Use any supported provider by changing just two lines of code!
HTTP