1An example of using [Breadboard Board as a Service](https://www.val.town/v/dglazkov/bbaas) helper script. The board converts supplied text and voice into speech using Eleven Labs API.
2
3This board is marked as `private`, which means that it requires an additional service key to function.
7- fork this val
8- add `GEMINI_KEY` to your environment variables
9- add `ELEVENLABS_API_KEY` to your environment variables
10- add `BB_SERVICE_KEY` to your environment variables. You can use [this val](https://www.val.town/v/dglazkov/generateServiceKey) to generate it.
11- query directly or use as Service URL in the Core Kit `service` node.
1import { inTheBackground } from "https://esm.town/v/neverstew/inTheBackground";
2import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
3import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
4import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=45";
26 headers["Authorization"] = `Bearer ${token}`;
27 }
28 const { id } = await fetchJSON(`${API_URL}/v1/alias/${userHandle}/${valName}`, { headers });
29
30 const createCronEvalsTable = `CREATE TABLE IF NOT EXISTS cron_evals (
3
4
5To authenticate, use an [API Token](https://www.val.town/settings/api).
3
4
5To authenticate, use an [API Token](https://www.val.town/settings/api).
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34 rel="stylesheet"
35 />
1# Push Notification Sender
2
3This val can be used in other vals to send notifications to a segment using [OneSignal's REST API](https://documentation.onesignal.com/reference/create-notification)
4
5This is really handy if you want to send push notifications to your phone without building a native app! I built a barebones React PWA that asks for a password then loads the OneSignal Web SDK that I deployed to [Netlify](https://www.netlify.com/) for free. OneSignal has [easy to follow docs](https://documentation.onesignal.com/docs/web-sdk-setup) so you can build this functionality into a React, Angular, Vue app or even Wordpress! Then [install the PWA](https://www.bitcot.com/how-to-install-a-pwa-to-your-device/) on your platform of choice and you're off to the races!
7
8export default async function(req: Request): Promise<Response> {
9 // from https://automerge.org/automerge/api-docs/js/
10 type DocType = { ideas: Array<automerge.Text> };
11
2
3export const nasaImageDetails = async () => {
4 const nasaAPOD = await fetchJSON("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY");
5 let nasaImageHtml = nasaAPOD.hdurl
6 ? `<img width="100%" src="${nasaAPOD.hdurl}"/>`
3 "Access-Control-Allow-Methods": "GET,HEAD,PUT,PATCH,POST,DELETE",
4 "Access-Control-Allow-Headers":
5 "Content-Type, Access-Control-Allow-Headers, api-key",
6 "Access-Control-Max-Age": "2592000", // 30 days
7} as Record<string, string>;
15 const path = url.pathname;
16 const params = url.searchParams;
17 const apiKey = req.headers.get("api-key");
18 if (!apiKey) {
19 throw new Error("Missing API key");
20 }
21 const savedKey = Deno.env.get("QDRANT_API_KEY");
22 if (savedKey && apiKey !== savedKey) {
23 throw new Error("Invalid API key");
24 }
25 if (!params.has("cluster_id")) {