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")) {
1Since [Qdrant Cloud](https://qdrant.tech/cloud/) has a fairly strict CORS policy, here's a simple val that proxies calls to Qdrant Cloud API and makes them accessible from Web apps.
2
3 To set up:
4- fork this val
5- add your `QDRANT_API_KEY` to your environment variables. This would limit usage of your proxy to your API key only.
6- start using val as a proxy
7
8Use it as a 1:1 replacement for Qdrant API, except for one additional query string parameter:
9- `cluster_id` -- the part of the Qdrant API endpoint before `cloud.qdrant.io`.
89 <a href="https://x.com/pete_millspaugh/status/1805797615197635017">started prototyping</a>{" "}
90 a simple Membrane agent. Membrane already has a few core building blocks for agents—built-in memory,
91 standardized connection to tools (APIs, timers), and really good observability—so that should be a fun area for
92 us to continue exploring.
93 </p>
30}) => {
31 const { z } = await import("npm:zod");
32 const RESY_API_URL = "https://api.resy.com";
33 const RESY_DEFAULT_HEADERS = {
34 accept: "application/json, text/plain, */*",
35 "accept-encoding": "gzip, deflate, br",
36 "accept-language": "en-US,en;q=0.9",
37 authorization: "ResyAPI api_key=\"VbWk7s3L4KiK5fzlO7JD3Q5EYolJI7n5\"",
38 "x-origin": "https://resy.com",
39 origin: "https://resy.com/",
145 )
146 }&password=${encodeURIComponent(params.password)}`;
147 const response = await fetch(`${RESY_API_URL}/3/auth/password`, {
148 method: "POST",
149 body: body,
166 seats: number;
167 }) => {
168 const url = `${RESY_API_URL}/3/details`;
169 const response = await fetch(url.toString(), {
170 method: "POST",
185 seats: number;
186 }) => {
187 const url = `${RESY_API_URL}/4/find`;
188 const searchParams = new URLSearchParams();
189 searchParams.set("lat", "0");
208 city: string;
209 }) => {
210 const url = `${RESY_API_URL}/3/venue`;
211 const searchParams = new URLSearchParams();
212 searchParams.set("url_slug", params.slug);
224 authToken: string;
225 }) => {
226 const response = await fetch(`${RESY_API_URL}/3/book`, {
227 method: "POST",
228 headers: {
9```ts
10const resyBotCron = async () => {
11 const bookingInfo = await api(@vtdocs.resyBot, {
12 slug: 'amaro-bar',
13 city: 'ldn',