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=api&page=26&format=json

For typeahead suggestions, use the /typeahead endpoint:

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

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

Found 21529 results for "api"(2238ms)

postheroushttp-signatures.ts2 matches

@swayableUpdated 2 days ago
183 console.log('Body preview:', body.substring(0, 200) + '...');
184 console.log('Digest header (lowercase):', headers["digest"]);
185 console.log('Digest header (capitalized):', headers["Digest"]);
186 }
187
258 console.log('- Body preview (first 100 chars):', body.substring(0, 100) + '...');
259
260 // Use Web Crypto API to create SHA-256 hash
261 const encoder = new TextEncoder();
262 const data = encoder.encode(body);

postherousgenerate-keys.ts1 match

@swayableUpdated 2 days ago
24 console.log('🔐 Generating RSA key pair for ActivityPub HTTP signatures...');
25
26 // Generate RSA key pair using Web Crypto API
27 const keyPair = await crypto.subtle.generateKey(
28 {

postherousACTIVITYPUB.md1 match

@swayableUpdated 2 days ago
286- [WebFinger Specification](https://tools.ietf.org/html/rfc7033)
287- [ActivityStreams Vocabulary](https://www.w3.org/TR/activitystreams-vocabulary/)
288- [Mastodon API Documentation](https://docs.joinmastodon.org/spec/activitypub/)
289
290---

reflect-writeremailHandler.ts3 matches

@drewmcdonaldUpdated 2 days ago
3import { dedent } from "npm:ts-dedent";
4import { summarizeInputForDailyNote } from "./summarizeInput.ts";
5import * as ReflectApi from "./reflectApi.ts";
6
7const emailToText = (email: Email): string => {
16async function processEmail(email: Email) {
17 // first, create a new note with the contents of the email
18 const newNote = await ReflectApi.call("createNote", {
19 subject: email.subject,
20 content_markdown: email.text,
25
26 const summary = await summarizeInputForDailyNote(emailToText(email));
27 const result = await ReflectApi.call("appendToDailyNote", summary);
28 if (result.success === false) {
29 throw new Error(result.error);

reflect-writersummarizeInput.ts4 matches

@drewmcdonaldUpdated 2 days ago
4import { dedent } from "npm:ts-dedent";
5
6import * as ReflectApi from "./reflectApi.ts";
7
8const jsonSchema = ReflectApi.endpointJsonSchema("appendToDailyNote");
9
10export async function summarizeInputForDailyNote(
11 text: string,
12): Promise<ReflectApi.EndpointInput<"appendToDailyNote">> {
13 const openai = new OpenAI();
14
26 console.log("OpenAI response:", response);
27
28 return JSON.parse(response) as ReflectApi.EndpointInput<"appendToDailyNote">;
29}
30

reflect-writerhttpHandler.ts2 matches

@drewmcdonaldUpdated 2 days ago
2import z from "npm:zod";
3
4import * as ReflectApi from "./reflectApi.ts";
5import { summarizeInputForDailyNote } from "./summarizeInput.ts";
6
26 try {
27 const summary = await summarizeInputForDailyNote(input);
28 const result = await ReflectApi.call("appendToDailyNote", summary);
29 if (!result.success) {
30 return c.json(result, 500);

reflect-writerreflectApi.ts4 matches

@drewmcdonaldUpdated 2 days ago
2import { toJSONSchema } from "npm:zod";
3
4type ReflectApiEndpoint = {
5 path: string;
6 method: "PUT" | "POST";
8};
9
10const API_BASE_URL = "https://reflect.app/api/";
11
12export const endpoints = {
43 }),
44 },
45} as const satisfies Record<string, ReflectApiEndpoint>;
46
47export function endpointJsonSchema(
89
90 const response = await fetch(
91 `${API_BASE_URL}/graphs/${graphId}/${endpoint.path}`,
92 {
93 method: endpoint.method,

cognitoCallbackCLAUDE.md10 matches

@nholdenUpdated 2 days ago
13- Generate code in TypeScript or TSX
14- Add appropriate TypeScript types and interfaces for all data structures
15- Prefer official SDKs or libraries than writing API calls directly
16- Ask the user to supply API or library documentation if you are at all unsure about it
17- **Never bake in secrets into the code** - always use environment variables
18- Include comments explaining complex logic (avoid commenting obvious operations)
23### 1. HTTP Trigger
24
25- Create web APIs and endpoints
26- Handle HTTP requests and responses
27- Example structure:
167However, it's *extremely importing* to note that `parseProject` and other Standard Library utilities ONLY RUN ON THE SERVER.
168If you need access to this data on the client, run it in the server and pass it to the client by splicing it into the HTML page
169or by making an API request for it.
170
171## Val Town Platform Specifics
175- **AI Image:** To inline generate an AI image use: `<img src="https://maxm-imggenurl.web.val.run/the-description-of-your-image" />`
176- **Storage:** DO NOT use the Deno KV module for storage
177- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods
178- **Weather Data:** Use open-meteo for weather data (doesn't require API keys) unless otherwise specified
179- **View Source:** Add a view source link by importing & using `import.meta.url.replace("ems.sh", "val.town)"` (or passing this data to the client) and include `target="_top"` attribute
180- **Error Debugging:** Add `<script src="https://esm.town/v/std/catch"></script>` to HTML to capture client-side errors
181- **Error Handling:** Only use try...catch when there's a clear local resolution; Avoid catches that merely log or return 500s. Let errors bubble up with full context
182- **Environment Variables:** Use `Deno.env.get('keyname')` when you need to, but generally prefer APIs that don't require keys
183- **Imports:** Use `https://esm.sh` for npm and Deno dependencies to ensure compatibility on server and browser
184- **Storage Strategy:** Only use backend storage if explicitly required; prefer simple static client-side sites
218### Backend (Hono) Best Practices
219
220- Hono is the recommended API framework
221- Main entry point should be `backend/index.ts`
222- **Static asset serving:** Use the utility functions to read and serve project files:
242 });
243 ```
244- Create RESTful API routes for CRUD operations
245- Always include this snippet at the top-level Hono app to re-throwing errors to see full stack traces:
246 ```ts
279 - For files in the project, use `readFile` helpers
280
2815. **API Design:**
282 - `fetch` handler is the entry point for HTTP vals
283 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`

cognitoCallbackindex.ts2 matches

@nholdenUpdated 2 days ago
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
13
14// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
16
17// Unwrap and rethrow Hono errors as the original error
23
24 capturePostHogEvent(
25 Deno.env.get("phProjectAPIKey"),
26 webhookPayload.sender.login,
27 "GitHub Star",

telegram1 file match

@leduduUpdated 5 hours ago
中转telegram api

custom-domains-val-api

@nbbaierUpdated 1 day ago
snartapi
vapicxy