import "dotenv/config"; import { parseAtprotoIdentifier } from "./lib/utils/atcute.ts"; function requiredEnv(key: string): string { const value = process.env[key]; if (!value) { throw new Error( `❎ Environment variable ${key} is required but not set`, ); } return value; } const identifier = requiredEnv("PUBLIC_BOT_IDENTIFIER"); const { did, handle, pdsHost } = await parseAtprotoIdentifier(identifier); export const BOT_CREDENTIALS = { identifier: identifier, password: requiredEnv("BOT_PASSWORD"), }; export const BOT_DID = did; export const BOT_HANDLE = handle; export const BOT_SERVICE = pdsHost; export const JETSTREAM_URL = process.env.PUBLIC_JETSTREAM_URL || "wss://jetstream1.us-east.bsky.network/subscribe"; export const CDN_URL = process.env.PUBLIC_CDN_URL || "https://cdn.bsky.app/img"; export const FOLLOWER_MODE = process.env.PUBLIC_FOLLOWER_MODE === "true"; export const BACKEND_PORT = Number(process.env.PUBLIC_BACKEND_PORT ?? 8765);