This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" }); |