JavaScript-optional public web frontend for Bluesky anartia.kelinci.net
sveltekit atcute bluesky typescript svelte

feat: identify to constellation

mary.my.id 1add44cc ce9e58c9

verified
Changed files
+8 -2
src
lib
+2
.env
··· 1 1 PUBLIC_APP_NAME=Anartia 2 2 PUBLIC_APP_URL=https://anartia.kelinci.net 3 3 4 + PUBLIC_APP_USER_AGENT=codeberg:mary-ext/anartia 5 + 4 6 PUBLIC_APPVIEW_URL=https://public.api.bsky.app 5 7 PUBLIC_GO_BSKY_URL=https://go.bsky.app 6 8
+6 -2
src/lib/queries/constellation.ts
··· 4 4 5 5 import * as v from '@badrap/valita'; 6 6 7 - import { PUBLIC_CONSTELLATION_URL } from '$env/static/public'; 7 + import { PUBLIC_APP_USER_AGENT, PUBLIC_CONSTELLATION_URL } from '$env/static/public'; 8 8 9 9 import type { Did } from '$lib/types/identity'; 10 10 import { didString, integer, nsidString, recordKeyString } from '$lib/types/valita'; ··· 52 52 `&limit=${limit}` + 53 53 (cursor ? `&cursor=${cursor}` : ''); 54 54 55 - const response = await fetch(requestUrl); 55 + const response = await fetch(requestUrl, { 56 + headers: { 57 + 'user-agent': PUBLIC_APP_USER_AGENT, 58 + }, 59 + }); 56 60 if (!response.ok) { 57 61 // @todo: replace this with a non-SvelteKit error 58 62 error(503, `Constellation API returned ${response.status}`);