6 headers.set("Access-Control-Allow-Headers", "Content-Type");
7
8 // Define the subscriber ID and API details
9 const subscriberId = "sub_547dbfde-2a19-452c-9f98-bc80bcdce26c";
10 const apiUrl =
11 `https://api.beehiiv.com/v2/publications/pub_0928c801-3b5c-4d00-b836-fe34ae1ef82e/subscriptions/${subscriberId}`;
12 const apiToken = "Kl51jIvL23ViixtZFqa3k78TWgKiLT8OZXBXju2gnef65Zfi0Y2cEoNTvFB6IqeS";
13
14 try {
15 // Make the API request to fetch subscriber details
16 const response = await fetch(apiUrl, {
17 method: "GET",
18 headers: {
19 "Authorization": `Bearer ${apiToken}`,
20 "Content-Type": "application/json",
21 },
1# Framer Fetch: Basic
2
3A basic example of an API endpoint to use with Framer Fetch.
1# Framer Fetch: Basic
2
3A basic example of an API endpoint to use with Framer Fetch.
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12
26 const fetchWords = useCallback(async () => {
27 try {
28 const response = await fetch("https://random-word-api.herokuapp.com/all");
29 if (!response.ok) {
30 throw new Error("Failed to fetch words");
11[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
12
13It 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).
14
15# TODO
14}): Promise<TweetResult[]> {
15 const res = await twitterJSON({
16 url: `https://api.twitter.com/2/tweets/search/recent?query=${await searchParams(
17 {
18 query,
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 />
103 await email({
104 subject: "Website Scraper Error",
105 text: `An error occurred while scraping ${WEBSITE_URL}: ${error.message}`,
106 });
107 }