1import { authenticate, getCoreApiBaseEndpoint, jwtVerify } from "jsr:@commercelayer/js-auth";
2
3const auth = await authenticate("client_credentials", {
12if ("organization" in decodedJWT.payload) {
13 console.log("organization slug is", decodedJWT.payload.organization.slug);
14 console.log("base endpoint is", getCoreApiBaseEndpoint(auth.accessToken));
15}
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 />
83 <meta name="viewport" content="width=device-width, initial-scale=1.0">
84 <title>Good Vibes</title>
85 <link href="https://fonts.googleapis.com/css2?family=Shrikhand&display=swap" rel="stylesheet">
86 <style>${css}</style>
87 </head>
10 const { LangChainTracer } = await import("npm:langchain/callbacks");
11 const client = new Client({
12 apiUrl: "https://api.smith.langchain.com",
13 apiKey: process.env.LANGSMITH,
14 });
15 const tracer = new LangChainTracer({ client });
16 const callbacks = options?.verbose !== false ? [tracer] : [];
17 // Set up API key for each providers
18 const args = extend({ callbacks }, options);
19 if (spec?.provider === "openai")
20 args.openAIApiKey = process.env.OPENAI;
21 else if (spec?.provider === "huggingface")
22 args.apiKey = process.env.HUGGINGFACE;
23 // Populate model builders
24 const setup = cond([
10 const { LangChainTracer } = await import("npm:langchain/callbacks");
11 const client = new Client({
12 apiUrl: "https://api.smith.langchain.com",
13 apiKey: process.env.LANGSMITH,
14 });
15 const tracer = new LangChainTracer({ client });
16 const callbacks = options?.verbose !== false ? [tracer] : [];
17 // Set up API key for each providers
18 const args = extend({ callbacks }, options);
19 if (spec?.provider === "openai")
20 args.openAIApiKey = process.env.OPENAI;
21 else if (spec?.provider === "huggingface")
22 args.apiKey = process.env.HUGGINGFACE;
23 // Populate model builders
24 const setup = cond([
75```
76
77See the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) for reference.
78
79## Logout
1import { api } from "https://esm.town/v/pomdtr/api";
2import { zip } from "https://esm.town/v/pomdtr/sql";
3import { sqlite } from "https://esm.town/v/std/sqlite";
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO
1import Exa from "npm:exa-js@1.1.3";
2
3const exa = new Exa("f2e3bc4c-a68d-4dcb-abf6-a34ee090a576", "https://api-internal.exa.sh");
4
5const result = await exa.getContents(