+15
-3
script.ts
+15
-3
script.ts
···
1
-
import {AtpAgent} from "@atproto/api";
1
+
import { AtpAgent } from "@atproto/api";
2
2
import dotenv from "dotenv";
3
3
4
4
dotenv.config();
···
51
51
const agent = new AtpAgent({ service: PDS_URL });
52
52
53
53
await agent.login({ identifier: IDENTIFIER, password: PASSWORD });
54
-
55
-
console.log(agent);
54
+
55
+
const handle = agent.session?.handle;
56
+
57
+
if (handle) {
58
+
const profile = await agent.app.bsky.actor.getProfile({
59
+
actor: handle
60
+
});
61
+
62
+
if (profile) {
63
+
const bio = profile.data.description;
64
+
65
+
console.log(bio);
66
+
}
67
+
}
56
68
};
57
69
58
70
main();