1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// @ts-check
import { API_URL } from "https://esm.town/v/std/API_URL";
const VALTOWN_API_URL = API_URL.concat("/v1");
// const VALTOWN_API_URL = "https://api.val.town/v1";
/**
* @returns {Promise<string>} the uuid of the user as an string
**/
export const getMyValTownUserUUID = async () => {
return (await (await fetch(`${VALTOWN_API_URL}/me`, {
headers: {
Authorization: `Bearer ${Deno.env.get("valtown")}`,
Accept: "application/json",
},
})).json()).id;
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
January 19, 2024