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/$2?q=api&page=29&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 18131 results for "api"(812ms)

markdown-embedsetPageID.ts1 match

@stevekrouseโ€ขUpdated 2 days ago
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7

markdown-embedsetPageIcon.ts1 match

@stevekrouseโ€ขUpdated 2 days ago
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7

markdown-embedsetDemoURL.ts1 match

@stevekrouseโ€ขUpdated 2 days ago
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7

markdown-embedsetCobrowse.ts1 match

@stevekrouseโ€ขUpdated 2 days ago
13 console.log(page.id);
14 // get the cobrowse value from the payload
15 // warning: properties in Notion are capitalized as a convention (see Cobrowse)
16 const cobrowse = (page.properties.Cobrowse.checkbox) ? false : true;
17 // save new cobrowse boolean to Notion page

markdown-embedsetCobrowse.ts1 match

@stevekrouseโ€ขUpdated 2 days ago
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7

markdown-embedsetAction.ts1 match

@stevekrouseโ€ขUpdated 2 days ago
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7

markdown-embedroot.ts2 matches

@stevekrouseโ€ขUpdated 2 days ago
6// Initialize Notion client
7const notion = new Client({
8 auth: Deno.env.get("NOTION_API_KEY"),
9});
10
20 {
21 status: "error",
22 message: "Failed to connect to Notion API",
23 error: error.message,
24 },

markdown-embedrecordClick.ts1 match

@stevekrouseโ€ขUpdated 2 days ago
7 console.log("click: ", JSON.stringify(clickData));
8
9 fetch("/api/action", {
10 method: "POST",
11 headers: {

markdown-embedREADME.md11 matches

@stevekrouseโ€ขUpdated 2 days ago
17 let html = await readFile("/frontend/index.html", import.meta.url);
18
19 const response = await fetch(`/api/demo/${id}`);
20 const initialData = await response.json();
21
87// Client-side event recording
88window.recordClick = function (action) {
89 fetch(`/api/setAction`, {
90 method: "POST",
91 headers: { "Content-Type": "application/json" },
103
104```
105โ”œโ”€โ”€ backend/ # Server-side logic and API routes
106โ”‚ โ”œโ”€โ”€ controllers/ # Business logic for Notion integration
107โ”‚ โ”œโ”€โ”€ crons/ # Scheduled tasks for cache management
108โ”‚ โ”œโ”€โ”€ routes/ # HTTP route handlers
109โ”‚ โ”‚ โ”œโ”€โ”€ api/ # JSON API endpoints
110โ”‚ โ”‚ โ”œโ”€โ”€ tasks/ # Notion webhook handlers
111โ”‚ โ”‚ โ””โ”€โ”€ views/ # HTML page serving
121### Backend (`/backend`)
122
123Handles all server-side operations including API routes, Notion integration, and static file serving. Built with Hono for routing and includes authentication middleware.
124
125### Frontend (`/frontend`)
134
135- **Val Town & Deno**: Serverless runtime environment with TypeScript support
136- **Notion Client**: Official npm library for Notion API integration
137- **Hono**: Lightweight web framework for routing and middleware
138- **Blob Storage**: Val Town's built-in caching solution for performance optimization
170
171// Route modules
172app.route("/api", api); // JSON API endpoints
173app.route("/tasks", tasks); // Notion webhook handlers
174app.route("/demo", demo); // Demo page serving
175```
176
177#### API Routes (`/api`)
178
179Serve JSON data and handle CRUD operations for demo management, cobrowsing status, and user interactions.
241```typescript
242const notion = new Client({
243 auth: Deno.env.get("NOTION_API_KEY"),
244});
245
249Required environment variables:
250
251- `NOTION_API_KEY`: Notion integration token
252- `GLANCE_DEMOS_DB_ID`: Notion database ID for demo pages
253- `GLANCE_INTERACTIONS_DB_ID`: Notion database ID for interaction tracking
289Different route areas serve specific purposes:
290
291- `/api/*`: JSON data endpoints for frontend consumption
292- `/demo/*`: Personalized demo page serving with data injection
293- `/tasks/*`: Notion webhook processing and database updates

markdown-embedREADME.md1 match

@stevekrouseโ€ขUpdated 2 days ago
7### Task endpoints use /controllers to get and save data
8
9In order to keep the API easy to look and work with, the routes in /tasks handle routing but do not get data from or save data to Notion. The functions that connect to Notion live in the /controllers directory, and are _called_ from the endpoints in /tasks.
10
11### Naming convention for routes and controllers

xxxclearinghouse_validator

@toowiredโ€ขUpdated 2 hours ago
Request validator for clearance API

Apiify11 file matches

@wolfโ€ขUpdated 20 hours ago
apiry
snartapi