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=4&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 15182 results for "api"(2218ms)

Airtable312 words

https://docs.val.town/integrations/airtable/
airtable = new Airtable({ apiKey: Deno.env.get("airtable_pat"), baseId: "appXSrKDlwbAijRmD", tableName: "All content", }); // Sample data from: https://blog.airtable.com/database-vs-spreadsheet/ const results = await airtable.select(); console.log(results); Make sure to change: apiKey if you

Sections

Setup

airtable = new Airtable({ apiKey: Deno.env.get("airtable_pat"), baseId: "appXSrKDlwbAijRmD", tableName: "All content", }); // Sample data from: https://blog.airtable.com/database-vs-spreadsheet/ const results = await airtable.select(); console.log(results); Make sure to change: apiKey if you

Upgrade Guide: Safer Val Scopes333 words

https://docs.val.town/troubleshooting/std-set-permission-error/
in ChatGPT Ask questions about this page. On Nov 1, 2024, we announced safer default API scopes for vals, which don’t include the val:write scope. Some users were not included

Sections

Upgrade Guide: Safer Val Scopes

in ChatGPT Ask questions about this page. On Nov 1, 2024, we announced safer default API scopes for vals, which don’t include the val:write scope. Some users were not included

CORS356 words

https://docs.val.town/troubleshooting/cors/
from any domain (*). Support common HTTP methods without additional configuration. Work with standard web APIs and frameworks. Handle preflight requests automatically. This default configuration is beneficial for development, allowing

Sections

Default CORS Configuration

from any domain (*). Support common HTTP methods without additional configuration. Work with standard web APIs and frameworks. Handle preflight requests automatically. This default configuration is beneficial for development, allowing

Email423 words

https://docs.val.town/std/email/
"Hi", headers: { "X-Custom-Header": "xxx", }, }), ). This is also documented in our REST API, and supported in the SDK. Custom email addresses. Email triggers support custom addresses in

Sections

Headers

"Hi", headers: { "X-Custom-Header": "xxx", }, }), ). This is also documented in our REST API, and supported in the SDK.

Version Control465 words

https://docs.val.town/reference/version-control/
file: import { min } from "npm:lodash-es@4"; We highly recommend pinning imported modules because their APIs can change between versions and unexpectedly break your code. Lockfiles. When you save a

Sections

Versions of external imports

file: import { min } from "npm:lodash-es@4"; We highly recommend pinning imported modules because their APIs can change between versions and unexpectedly break your code.

Permissions899 words

https://docs.val.town/reference/permissions/
url: "http://localhost:3001/v1/fetch?url=https%3A%2F%2Fuser-secretEndpoint.web.val.run". } By supplying the environment variable in a header, I’m allowed access: With authenticationRun in Val Town ↗ import { fetch } from "https://esm.town/v/std/fetch"; const response = await

Sections

Exposing your vals to the internet

url: "http://localhost:3001/v1/fetch?url=https%3A%2F%2Fuser-secretEndpoint.web.val.run". } By supplying the environment variable in a header, I’m allowed access: With authenticationRun in Val Town ↗ import { fetch } from "https://esm.town/v/std/fetch"; const response = await

Stripe714 words

https://docs.val.town/integrations/stripe/
from "https://esm.town/v/stevekrouse/discordWebhook"; import Stripe from "npm:stripe"; const stripe = new Stripe( Deno.env.get("stripe_sk_customer_readonly") as string, { apiVersion: "2020-08-27", } ); function getStripeCustomer(customerId: string) { return stripe.customers.retrieve(customerId); } export let newStripeEvent =

Sections

Stripe Checkout

Val Town: https://val.town/v/std/stripeCheckoutQuickstart. // @ts-ignore. import { Stripe } from "npm:stripe"; const stripe = new Stripe(Deno.env.get("STRIPE_TEST_API_KEY")); export default async function (req: Request): Promise<Response> { const url = new URL(req.url); if

Example Val Town Stripe Webhook

from "https://esm.town/v/stevekrouse/discordWebhook"; import Stripe from "npm:stripe"; const stripe = new Stripe( Deno.env.get("stripe_sk_customer_readonly") as string, { apiVersion: "2020-08-27", } ); function getStripeCustomer(customerId: string) { return stripe.customers.retrieve(customerId); } export let newStripeEvent =

Github user's stars (pagination)426 words

https://docs.val.town/integrations/github/github-users-stars-pagination/
"https://esm.town/v/stevekrouse/fetchJSON?v=41"; export const getGithubStars = async (username: string) => { const user = await fetchJSON( `https://api.github.com/users/${username}`, ); let totalStars = 0; // Paginate the max number of pages per request.

Sections

Github user's stars (pagination)

"https://esm.town/v/stevekrouse/fetchJSON?v=41"; export const getGithubStars = async (username: string) => { const user = await fetchJSON( `https://api.github.com/users/${username}`, ); let totalStars = 0; // Paginate the max number of pages per request.

Email yourself when you get a comment reaction!

emailGithubReactions = async () => { const username = "stevekrouse"; const events = await fetchJSON( `https://api.github.com/users/${username}/events?per_page=100`, { headers: { Authorization: `Bearer ${githubPatToken}`, }, }, ); const comments = events.filter((event) =>

Send messages to Slack247 words

https://docs.val.town/integrations/slack/send-messages-to-slack/
and send a request to it with a message payload. 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.

Sections

Create a Slack app

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.

Telegram bot544 words

https://docs.val.town/integrations/telegram/
url from req.url. // This is a no-op if nothing's changed. if (!isEndpointSet) { await bot.api.setWebhook(req.url, { secret_token: SECRET_TOKEN, }); isEndpointSet = true; } if (req.method === "POST") { return

Sections

2. Create a webhook handler to receive messages

url from req.url. // This is a no-op if nothing's changed. if (!isEndpointSet) { await bot.api.setWebhook(req.url, { secret_token: SECRET_TOKEN, }); isEndpointSet = true; } if (req.method === "POST") { return

cerebras_coderindex.html3 matches

@canstralian•Updated 5 hours ago
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>CerebrasCoder</title>
7 <link rel="preconnect" href="https://fonts.googleapis.com" />
8 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9 <link
10 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
11 rel="stylesheet"
12 />
21 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
22 <meta property="og:type" content="website">
23 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
24
25

cerebras_codergenerate-code.ts1 match

@canstralian•Updated 5 hours ago
16 };
17 } else {
18 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
19 const completion = await client.chat.completions.create({
20 messages: [

HN-fetch-call2 file matches

@ImGqb•Updated 16 hours ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openai•Updated 2 days ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
Kapil01
apiv1