Skip to content

Instantly share code, notes, and snippets.

View TundraShark's full-sized avatar
🦈
I love creating software

‎‎‎‎Tundra Shark TundraShark

🦈
I love creating software
View GitHub Profile
@TundraShark
TundraShark / main.ts
Created December 1, 2024 22:05
Blocking and unblocking users using the Bluesky API
import "dotenv/config";
import { AtpAgent, AtUri } from "@atproto/api";
import { OAuthClient } from "@atproto/oauth-client";
import { Response } from "@atproto/api/dist/client/types/com/atproto/server/createSession";
const BSKY_HANDLE = process.env.BSKY_HANDLE ?? (() => { throw new Error("Missing BSKY_HANDLE in environment variable"); })();
const BSKY_API_KEY = process.env.BSKY_API_KEY ?? (() => { throw new Error("Missing BSKY_API_KEY in environment variable"); })();
async function Authenticate (): Promise<AtpAgent> {
const agent = new AtpAgent({ service: "https://bsky.social" });