Public
Script
February 28, 2024
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import ky from "npm:ky";
const prefixUrl = "https://public.api.bsky.app/xrpc/";
// @see: https://docs.bsky.app/docs/api/com-atproto-identity-resolve-handle
export function resolveHandle(handle: string) {
return ky.get("com.atproto.identity.resolveHandle", {
searchParams: { handle },
prefixUrl,
}).json();
}
// @see: https://docs.bsky.app/docs/api/app-bsky-feed-get-post-thread
export function getPostThread(uri: string) {
return ky.get("app.bsky.feed.getPostThread", {
searchParams: { uri },
prefixUrl,
}).json();
}
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!
February 28, 2024