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=3&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 4129 results for "api"(423ms)

Slack bot428 words

https://docs.val.town/integrations/slack/bot/
events from Slack’s Events API via the Express API. In this guide, you’ll build a bot that replies whenever it’s mentioned. 1. Create a Slack app. Visit https://api.slack.com/apps?new_app=1, create a

Sections

Slack bot

build a Slack bot using vals. Vals can receive events from Slack’s Events API via the Express API. In this guide, you’ll build a bot that replies whenever it’s mentioned.

1. Create a Slack app

1. Create a Slack app. Visit https://api.slack.com/apps?new_app=1, create a new app From Scratch, and choose your App Name and your workspace.

Runtime146 words

https://docs.val.town/reference/runtime/
so they can make HTTP requests. Vals have access to environment variables. The experimental Temporal API is enabled. Included environment. fetch to make HTTP requests. import from npm and https.

Sections

Runtime

so they can make HTTP requests. Vals have access to environment variables. The experimental Temporal API is enabled.

Basic examples173 words

https://docs.val.town/vals/http/basic-examples/
unlike other vals, expose a public endpoint. An HTTP val that works with the Web API takes a Request object as input and returns a Response object. The most basic

Sections

Basic examples

unlike other vals, expose a public endpoint. An HTTP val that works with the Web API takes a Request object as input and returns a Response object. The most basic

Routing175 words

https://docs.val.town/vals/http/routing/
in ChatGPT Ask questions about this page. One of the coolest things about the Request/Response API is that it works with modern web frameworks, so you can use routing and

Sections

Routing

in ChatGPT Ask questions about this page. One of the coolest things about the Request/Response API is that it works with modern web frameworks, so you can use routing and

Saving data from a web page513 words

https://docs.val.town/guides/saving-data-from-a-web-page/
to interact with it. You can either use form submissions or client-side JavaScript to make API calls to Val Town. Blob storage. For example, this val is an app that

Sections

Saving data from a web page

to interact with it. You can either use form submissions or client-side JavaScript to make API calls to Val Town.

Blob storage

This is a fork of the above app that uses client-side React to make the API calls: You could easily host the React part anywhere (Vercel, Netlify, etc) and have

Vulnerability Disclosure Policy325 words

https://docs.val.town/contact-us/security/
severity of the exploit found. In-scope domains. Val Town uses the following domains: val.town. valtown.email. api.val.town. esm.town. val.run. Subdomains of these domains are in scope for the program. Out of

Sections

In-scope domains

In-scope domains. Val Town uses the following domains: val.town. valtown.email. api.val.town. esm.town. val.run. Subdomains of these domains are in scope for the program.

Discord bot626 words

https://docs.val.town/integrations/discord/how-to-make-a-discord-bot-hosted-24-7-for-free-in-/
Val Town is a social website to write, run, and host JavaScript. You can create APIs, scheduled functions, email yourself, and persist small pieces of data — all from the

Sections

Step 3: Login to Val Town

Step 3: Login to Val Town. Val Town is a social website to write, run, and host JavaScript. You can create APIs, scheduled functions, email yourself, and persist small pieces

Further Directions

you want. You’ll probably want to: Register a new Slash Command. Connect your bot to APIs like OpenAI’s GPT or Dall-E. Come join us in the Val Town Discord if

Simplified val privacy275 words

https://docs.val.town/upgrading/simplified-val-privacy/
the privacy of a Val via the UI. There is currently no way to change the privacy status of Val via the API, but we plan to add that shortly.

Sections

Upgrading

the privacy of a Val via the UI. There is currently no way to change the privacy status of Val via the API, but we plan to add that shortly.

LLM prompting325 words

https://docs.val.town/quickstarts/prompting/
Val Town CLI: Terminal window # Install CLI. deno install -gAfr jsr:@valtown/vt. # Set API token. export VAL_TOWN_API_KEY=vtwn_replaceThis. # Clone project locally. vt clone my-project. Step 2: Add Val Town

Sections

Step 1: Setup

Val Town CLI: Terminal window # Install CLI. deno install -gAfr jsr:@valtown/vt. # Set API token. export VAL_TOWN_API_KEY=vtwn_replaceThis. # Clone project locally. vt clone my-project.

Environment variables280 words

https://docs.val.town/reference/environment-variables/
text. Open in ChatGPT Ask questions about this page. You can store secrets, keys, and API token in two places: Global Environment Variables: For single Vals, but not accessible in

Sections

Environment variables

text. Open in ChatGPT Ask questions about this page. You can store secrets, keys, and API token in two places: Global Environment Variables: For single Vals, but not accessible in

stevensDemoREADME.md5 matches

@brenwildt42•Updated 23 hours ago
8## Hono
9
10This app uses [Hono](https://hono.dev/) as the API framework. You can think of Hono as a replacement for [ExpressJS](https://expressjs.com/) that works in serverless environments like Val Town or Cloudflare Workers. If you come from Python or Ruby, Hono is also a lot like [Flask](https://github.com/pallets/flask) or [Sinatra](https://github.com/sinatra/sinatra), respectively.
11
12## Serving assets to the frontend
20### `index.html`
21
22The most complicated part of this backend API is serving index.html. In this app (like most apps) we serve it at the root, ie `GET /`.
23
24We *bootstrap* `index.html` with some initial data from the server, so that it gets dynamically injected JSON data without having to make another round-trip request to the server to get that data on the frontend. This is a common pattern for client-side rendered apps.
25
26## CRUD API Routes
27
28This app has two CRUD API routes: for reading and inserting into the messages table. They both speak JSON, which is standard. They import their functions from `/backend/database/queries.ts`. These routes are called from the React app to refresh and update data.
29
30## Errors
31
32Hono and other API frameworks have a habit of swallowing up Errors. We turn off this default behavior by re-throwing errors, because we think most of the time you'll want to see the full stack trace instead of merely "Internal Server Error". You can customize how you want errors to appear.

stevensDemoNotebookView.tsx5 matches

@brenwildt42•Updated 23 hours ago
8import { type Memory } from "../../shared/types.ts";
9
10const API_BASE = "/api/memories";
11const MEMORIES_PER_PAGE = 20;
12
71 setError(null);
72 try {
73 const response = await fetch(API_BASE);
74 if (!response.ok) {
75 throw new Error(`HTTP error! status: ${response.status}`);
100
101 try {
102 const response = await fetch(API_BASE, {
103 method: "POST",
104 headers: { "Content-Type": "application/json" },
123
124 try {
125 const response = await fetch(`${API_BASE}/${id}`, {
126 method: "DELETE",
127 });
155
156 try {
157 const response = await fetch(`${API_BASE}/${editingMemory.id}`, {
158 method: "PUT",
159 headers: { "Content-Type": "application/json" },

openapi2 file matches

@stevekrouse•Updated 1 day ago

dbToAPI_backup4 file matches

@nbbaier•Updated 3 days ago
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)