94 content.push({ type: 'text', text: prompt });
95
96 const response = await fetch('https://api.anthropic.com/v1/messages', {
97 method: 'POST',
98 headers: {
1export async function testReminder() {
2 fetch('https://jsonplaceholder.typicode.com/todos/1')
3 .then(response => response.json())
4 .then(json => console.log(json)
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
4import { weatherGovGrid } from "https://esm.town/v/stevekrouse/weatherGovGrid";
14 lon,
15 });
16 let { properties: { periods } } = await fetchJSON(
17 grid.forecastHourly,
18 );
26};
27
28const response = await fetch("https://<your-val-id>.web.val.run/", {
29 method: "POST",
30 headers: {
88 const contactId = event.objectId.toString();
89
90 const propertiesToFetch = ["email", "firstname", "lastname"];
91 const contactDetailsSdk = await hubspotClient.crm.contacts.basicApi.getById(
92 contactId,
93 propertiesToFetch,
94 );
95
167 };
168
169 const perplexityResponse = await fetch("https://api.perplexity.ai/chat/completions", {
170 method: "POST",
171 headers: {
8 const [error, setError] = useState(null);
9
10 const fetchData = async () => {
11 try {
12 const userEndpoint = new URL(USER_ENDPOINT, window.location.origin);
13
14 const res = await fetch(userEndpoint);
15 const data = await res.json();
16 if (!res.ok) {
33
34 useEffect(() => {
35 fetchData();
36 }, []);
37
38 return { data, loading, error, refetch: fetchData };
39}
40
9 const [error, setError] = useState(null);
10
11 const fetchData = async () => {
12 try {
13 const projectEndpoint = new URL(PROJECT_ENDPOINT, window.location.origin);
17 if (branchId) filesEndpoint.searchParams.append("branchId", branchId);
18
19 const { project } = await fetch(projectEndpoint).then((res) =>
20 res.json()
21 );
22 const { files } = await fetch(filesEndpoint).then((res) => res.json());
23
24 setData({ project, files });
34 useEffect(() => {
35 if (!projectId) return;
36 fetchData();
37 }, [projectId, branchId]);
38
39 return { data, loading, error, refetch: fetchData };
40}
41
8 const [error, setError] = useState(null);
9
10 const fetchData = async () => {
11 try {
12 const res = await fetch(ENDPOINT);
13 const data = await res.json();
14 if (!res.ok) {
32
33 useEffect(() => {
34 fetchData();
35 }, []);
36
37 return { data, loading, error, refetch: fetchData };
38}
39
19 setError(null);
20 try {
21 const res = await fetch(ENDPOINT, {
22 method: "POST",
23 headers: {
12 setData(null);
13 setError(null);
14 const res = await fetch(ENDPOINT, {
15 method: "POST",
16 body: JSON.stringify({