falDemoAppmain.tsx2 matches
15try {
16const fal = createFalClient({
17proxyUrl: "/api/fal/proxy",
18});
19139}
140141if (url.pathname === "/api/fal/proxy") {
142return falProxyRequest(req);
143}
geminiBboxmain.tsx15 matches
6*
7* Key features:
8* - Integrates with Google's Generative AI API
9* - Processes user-uploaded images for object detection
10* - Visualizes detected objects with bounding boxes
11* - Allows customization of detection parameters (grid, contrast)
12* - Stores API key securely in browser's local storage
13*
14* The app is built using Hono.js and can be deployed on Val Town or run locally with Deno.
29<p>This application visualizes object detection results by drawing bounding boxes on images using the <a href="https://ai.google.dev/">Google's Gemini 1.5 Pro AI model</a>.</p>
3031<p>API keys are only stored in your browser's local storage.</p>
32<p>Images are only sent to Google's Gemini API servers for processing.</p>
3334<p>Try the following images (click the links to add them):</p>
174window.handleImageUrlClick = handleImageUrlClick;
175176// Retrieves the API key from local storage or prompts the user to enter it
177function getApiKey() {
178let apiKey = localStorage.getItem("GEMINI_API_KEY");
179if (!apiKey) {
180apiKey = prompt("Please enter your Gemini API key:");
181if (apiKey) {
182localStorage.setItem("GEMINI_API_KEY", apiKey);
183}
184}
185return apiKey;
186}
187188// Initializes and returns a Google Generative AI model instance
189async function getGenerativeModel(params) {
190const API_KEY = getApiKey();
191const genAI = new GoogleGenerativeAI(API_KEY);
192return genAI.getGenerativeModel(params);
193}
915<div class="mt-2">
916<p>Use this to detect bounding boxes of objects in an image. Use the image description to help with setting up the prompt. Rows and columns determine how many tiles the image will be divided into — for simple images, 1x1 is best.</p>
917<p>For the free API you might get the "Resource has been exhausted" error if you make too many requests too quickly.</p>
918<textarea id="promptInput" rows=6>Identify and return bounding boxes of the (MAIN SUBJECT) \n[ymin, xmin, ymax, xmax]</textarea>
919<div class="checkbox-container my-2">
fullWebsiteVersionmain.tsx1 match
7374const lsdResponse = await fetch(
75`https://lsd.so/api?query=${encodeURIComponent(query)}`,
76);
77
BBslackScoutREADME.md4 matches
7## Getting Started
8To run Slack Scout, you’ll need a
9- Browserbase API key
10- Slack Webhook URL: setup [here](https://docs.val.town/integrations/slack/send-messages-to-slack/)
11- Twitter Developer API key
1213### Browserbase
192021We’ve decided to use the Twitter API to include Twitter post results. It costs $100 / month to have a Basic Twitter Developer account. _If you decide to use Browserbase, we can lend our token. Comment below for access._
2223Once you have the `SLACK_WEBHOOK_URL`, `BROWSERBASE_API_KEY`, and `TWITTER_BEARER_TOKEN`, input all of these as [Val Town Environment Variables](https://www.val.town/settings/environment-variables).
2425---
BBslackScoutmain.tsx3 matches
54query: topic,
55pages: 2,
56apiKey: Deno.env.get("BROWSERBASE_API_KEY") ?? "",
57});
58}
63maxResults: 10,
64daysBack: 1,
65apiKey: Deno.env.get("TWITTER_BEARER_TOKEN") ?? "",
66});
67}
9899if (!response.ok) {
100throw new Error(`Slack API error: ${response.status} ${response.statusText}`);
101}
102
falProxyRequestmain.tsx1 match
4const headers = new Headers(req.headers);
5headers.set("x-proxy-authorization", `Bearer ${Deno.env.get("valtown")}`);
6return fetch("https://fal-faltownproxy.web.val.run/api/faltown/proxy", {
7method,
8headers,
testplaywrightmain.tsx5 matches
5console.info("Launching browser...");
67// Use Deno.env to get the API key
8const apiKey = Deno.env.get("BROWSERBASE_API_KEY");
9if (!apiKey) {
10console.error("BROWSERBASE_API_KEY environment variable is not set");
11Deno.exit(1);
12}
14try {
15const browser = await chromium.connectOverCDP(
16`wss://connect.browserbase.com?apiKey=${apiKey}`,
17);
18console.info("Connected!");
discordActivityClientmain.tsx5 matches
51// /.proxy/ is prepended here in compliance with CSP
52// see https://discord.com/developers/docs/activities/development-guides#construct-a-full-url
53const response = await fetch("/.proxy/api/token", {
54method: "POST",
55headers: {
104105/**
106* This function utilizes RPC and HTTP apis, in order show the current guild's avatar
107* Here are the steps:
108* 1. From RPC fetch the currently selected voice channel, which contains the voice channel's guild id
109* 2. From the HTTP API fetch a list of all of the user's guilds
110* 3. Find the current guild's info, including its "icon"
111* 4. Append to the UI an img tag with the related information
117}
118119// 1. From the HTTP API fetch a list of all of the user's guilds
120const guilds = await fetch(
121"https://discord.com/api/users/@me/guilds",
122{
123headers: {
arcGISHonoMiddlewaremain.tsx1 match
108109/**
110* Converts parameters to the proper representation to send to the ArcGIS REST API.
111* @param params The object whose keys will be encoded.
112* @return A new object with properly encoded values.
1Copy of [ArcGISIdentityManager.authorize()](https://github.com/Esri/arcgis-rest-js/blob/bfd7ce977d9879077e92fabfc491240d8f230844/packages/arcgis-rest-request/src/ArcGISIdentityManager.ts#L760), OAuth2 authentication for the ESRI ArcGIS API which is implemented as Express middleware, ported to Hono.
23Migrated from folder: gisc/arcGISHonoMiddleware