Skip to content

Conversation

@anbraten
Copy link
Contributor

@anbraten anbraten commented Nov 30, 2024

Tested how the lib could work. For now I've added a xrpc-client that takes a session (either password or later on oauth). The client can now be used by tsky to do api calls.

It would be use like this:

const session = new PasswordSession(TEST_ENDPOINT);
await session.login('did:from-alice', 'alice has a nice app password');
const tSky = new TSky(session);

Currently I got those two calls to work:

For the user's profile:

const profile = await tSky.profile(TEST_CREDENTIALS.alice.did);
console.log(profile);

To get the timeline of the user:

const paginator = tSky.feed.timeline({
  limit: 30,
});

await paginator.next(); // load the first page

console.log(paginator.values[0].feed); // print the feed array from the first page

@netlify
Copy link

netlify bot commented Nov 30, 2024

Deploy Preview for tsky canceled.

Name Link
🔨 Latest commit 0acd74a
🔍 Latest deploy log https://app.netlify.com/sites/tsky/deploys/674b135a98f6e8000882bf6b

@anbraten
Copy link
Contributor Author

While baking on these changes I've noticed that we would need to replicate the quite well developed xrpc-client and session refreshing parts from atproto or atcute. Therefore it might be a good idea to for example use the atcute client underneath.

@anbraten anbraten mentioned this pull request Dec 5, 2024
@shuuji3
Copy link
Collaborator

shuuji3 commented Feb 9, 2025

This was superseded by #32. Thanks for exploring this early approach 🙏🏻

@shuuji3 shuuji3 closed this Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants