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/?q=fetch&page=131&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 18940 results for "fetch"(3799ms)

pdf-title-suggestermain.tsx1 match

@srburk•Updated 3 weeks ago
150
151 try {
152 const res = await fetch(location.href, {
153 method: "POST",
154 headers: { "content-type": "application/json" },

sqliteExplorerAppmain.tsx4 matches

@boost_bug•Updated 3 weeks ago
1/** @jsxImportSource npm:hono/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));
123 const timeoutId = setTimeout(() => controller.abort(), 25000); // 25 second timeout
124
125 const response = await fetch(`${this.baseUrl}/chat/completions`, {
126 method: 'POST',
127 headers,

worldspecmain.tsx4 matches

@join•Updated 3 weeks ago
539(function() {
540 // SOLUTION: Use an empty string for the API_URL.
541 // This makes fetch requests relative to the current domain.
542    const API_URL = "";
543    let sessionId = 'sess_' + Date.now() + Math.random().toString(36).substr(2, 9);
582
583        try {
584            const res = await fetch(\`\${API_URL}/build-world\`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ description, sessionId }) });
585            const data = await res.json();
586            if (!res.ok || !data.ok) throw new Error(data.error || 'The AI architect needs a moment. Please try again.');
624
625        try {
626            const res = await fetch(\`\${API_URL}/command\`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-session-id': sessionId }, body: JSON.stringify({ cmd, args }) });
627            const data = await res.json();
628            if (!res.ok || !data.ok) throw new Error(data.error || 'The robot encountered an issue. Try a different command!');
727}
728
729export default app.fetch;

sendPushNotifsmain.js3 matches

@sct•Updated 3 weeks ago
4 let pushTokens: string[] = [];
5 try{
6 const res = await fetch("https://sct--c04a76ea75d611f08a410224a6c84d84.web.val.run",{
7 method: "GET",
8 });
9 if(!res.ok) throw new Error("Failed to fetch tokens");
10 pushTokens = await res.json();
11
25 }));
26 try {
27 const res = await fetch("https://exp.host/--/api/v2/push/send",{
28 method: "POST",
29 headers: {"Content-Type": "application/json"},

untitled-6958index.ts1 match

@michaellatman•Updated 3 weeks ago
21
22 // Send POST request to the webhook
23 const webhookResponse = await fetch(
24 'https://webhooks.tasklet.ai/v1/public/webhook?token=a6bb800345cb4fc36d216a674e70de8c',
25 {

location-feed-generatorendpoints.ts6 matches

@tijs•Updated 3 weeks ago
4import { generatePKCE } from "./dpop.ts";
5import { OAUTH_CONFIG } from "./config.ts";
6import { BlueskyProfileFetcher } from "../utils/profile-resolver.ts";
7import { setupOAuthWithSlingshot } from "./slingshot-resolver.ts";
8import { cleanupExpiredOAuthSessions } from "./session-cleanup.ts";
522 }
523
524 // Fetch user's profile to get avatar and display name
525 const profileFetcher = new BlueskyProfileFetcher();
526 const userProfile = await profileFetcher.fetchProfile(did);
527
528 // Set secure session cookie
972
973 // Get user profile for mobile response
974 const profileFetcher = new BlueskyProfileFetcher();
975 const profile = await profileFetcher.fetchProfile(sessionRow.did as string);
976
977 // Update profile info in database

location-feed-generatorMobileAuth.tsx1 match

@tijs•Updated 3 weeks ago
76 sessionStorage.setItem("pkce_code_verifier", codeVerifier);
77
78 const response = await fetch("/api/auth/mobile-start", {
79 method: "POST",
80 headers: {

pushREADME.md1 match

@pomdtr•Updated 3 weeks ago
33
34```ts
35fetch("https://YOUR_ENDPOINT_HERE/push", {
36 method: "POST",
37 headers: {

pushpushFrontend.js3 matches

@pomdtr•Updated 3 weeks ago
13 }
14 let clientSubscription = await registration.pushManager.getSubscription();
15 let serverSubscription = await (await fetch("/subscription")).json();
16
17 if (clientSubscription === null) {
47 button.disabled = true;
48 button.textContent = await (
49 await fetch("/subscription", {
50 method: "PUT",
51 body: JSON.stringify(
55 userVisibleOnly: true,
56 applicationServerKey: await (
57 await fetch("/vapidPublicKey")
58 ).text(),
59 }),

FetchBasic2 file matches

@bengold•Updated 1 week ago

fetch1 file match

@raify•Updated 2 weeks ago