Encrypted, ephemeral, private memos on atproto
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 27 lines 805 B view raw
1import { Client, CredentialManager } from "@atcute/client"; 2import { resolveMiniDoc } from "./resolve-did.ts"; 3import type { BaseClientOptions, ClientRequirements } from "./types.ts"; 4import { isHandle } from "@atcute/lexicons/syntax"; 5 6export async function produceRequirements<Options extends BaseClientOptions>( 7 options: Options, 8): Promise<ClientRequirements<Options>> { 9 if (!isHandle(options.handle)) { 10 throw new Error("provided handle is not valid"); 11 } 12 13 const miniDoc = await resolveMiniDoc(options.handle); 14 const manager = new CredentialManager({ service: miniDoc.pds }); 15 const rpc = new Client({ handler: manager }); 16 await manager.login({ 17 identifier: miniDoc.handle, 18 password: options.appPassword, 19 }); 20 21 return { 22 miniDoc, 23 manager, 24 rpc, 25 options, 26 }; 27}