Search
myApi
@sar
An interactive, runnable TypeScript val by sar
Script
export function myApi(name) {
return "hi " + name;
![rolling_coaster avatar](https://images.clerk.dev/oauth_github/img_2SHktXL41wjZX5A0jmcg2O0z7l4.jpeg)
myApi
@rolling_coaster
An interactive, runnable TypeScript val by rolling_coaster
Script
export function myApi(name) {
return "hi " + name;
val_8kG24m9t0L
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_8kG24m9t0L(req) {
try {
// Execute the code directly and capture its result
add_to_notion_w_ai_webpage
@nerdymomocat
Example usage of the add_to_notion_w_ai val Try with the money database . Read and watch the demo run here
HTTP
import OpenAI from "npm:openai";
const oai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY ?? undefined,
function createPrompt(title, description, properties) {
function processProperties(jsonObject) {
async function get_and_save_notion_db_processed_properties(databaseId)
async function get_notion_db_info(databaseId) {
async function get_and_save_notion_db_info(databaseId) {
function createZodSchema(filteredProps) {
function convertToNotionProperties(responseValues, filteredProps) {
![tr3ntg avatar](https://images.clerk.dev/oauth_github/img_2QyNgFrADFv8JHEaWwU4PAWF9zG.png)
myApi
@tr3ntg
An interactive, runnable TypeScript val by tr3ntg
Script
export function myApi(name) {
return "hi " + name;
spotify
@anthonyec
// Uncomment this line for one run of the Val to create the DB lol
HTTP
} catch (e) {
return c.json({ error: "Failed callback" + e });
async function getToken(c) {
const state = c.req.query("state") as string;
const authData = await db.select().from(table).where(eq(table.id, state)).limit(1);
![yawnxyz avatar](https://images.clerk.dev/oauth_github/img_2NnaHhpxNuH1xWRIRjQNoo16TVc.jpeg)
pageshot
@yawnxyz
// Inlined content from ./middleware.js
HTTP
"settings": {
"model": "gpt-4o-mini",
"provider": "openai",
"system": "please summarize the following article in a 2-4 sentences, describing it from a 3rd person point of view",
"prompt": "{jina.content}"
val_oXSqoQ1L7X
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_oXSqoQ1L7X(req) {
try {
const result = await (async () => {
function generateArrayProblems() {
const problems = [
"Implement a function to find the missing number in an array of 1 to N",
"Write a function to rotate an array by k positions",
"Create a function to merge two sorted arrays",
"Implement a function to find the longest increasing subsequence",
"Write a function to find pairs in array with sum equal to target"
return problems;
![stevekrouse avatar](https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg)
testMutateSemantics
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import process from "node:process";
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
export async function testMutateSemantics({
stateName,
api,
val_tBJyCZliwe
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_tBJyCZliwe(req) {
try {
// Execute the code directly and capture its result
moccasinTahr
@shivaanneu
// Fetches a random joke.
Cron
// ... imports ...
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
myApi
@mrfabbri
An interactive, runnable TypeScript val by mrfabbri
HTTP
export function myApi(name) {
return "hi " + name;
![andycoupe avatar](https://images.clerk.dev/oauth_github/img_2SZ5I5zH0UWUbwHMmnuZtV7sJBa.jpeg)
myApi
@andycoupe
An interactive, runnable TypeScript val by andycoupe
Script
export function myApi(name) {
return "hi " + name;
![henni avatar](https://images.clerk.dev/oauth_github/img_2TWwcqG3lysH501fqKj7bn3aNlm.png)
myApi
@henni
An interactive, runnable TypeScript val by henni
Script
export function myApi(name) {
return "hi " + name;
![neverstew avatar](https://secure.gravatar.com/avatar/109fa713caf4e083c57622b7c6dad365.jpg?s=200&d=identicon)
alias
@neverstew
An interactive, runnable TypeScript val by neverstew
Script
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
export function alias<P extends Params>(params: P): Promise<Result<P>> {
const username = params.username;
let url = `https://api.val.town/v1/alias/${username}`;