Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain how to generate a bearer token #62

Open
emilyliu7321 opened this issue Feb 6, 2024 · 3 comments
Open

Explain how to generate a bearer token #62

emilyliu7321 opened this issue Feb 6, 2024 · 3 comments

Comments

@emilyliu7321
Copy link
Collaborator

Explain how to generate a bearer token here: https://www.docs.bsky.app/docs/api/at-protocol-xrpc-api or update endpoints to publicly accessible ones that don't require bearer tokens

@jeffgca
Copy link

jeffgca commented Feb 9, 2024

This is huge - the ability to call the api right from the docs is great but there is no obvious docs for how to get the bearer token that enables this for much of the api.

@boly38
Copy link

boly38 commented May 17, 2024

💯 agree with this issue 👍

What I discover from community examples (example) is that the api seems directly available from agent.api scope,

Out of error this not appears in the doc or else I completely miss that point (that is possible :p).

Here is a simple example on how to call getPreferences() api without having to deal with token.

        // service, loginOptions
        const agent = new BskyAgent({service})
        agent.login(loginOptions);
        const response = await this.agent.api.app.bsky.actor.getPreferences();
        console.log(`response`, JSON.stringify(response, null, 2));

It would be great to have at least a little trigger like this in http reference introduction

(+ of course explain how to get bearer token from agent : seems to be loginResponse::accessJwt)

@rectalogic
Copy link

Fixed link: https://docs.bsky.app/docs/api/at-protocol-xrpc-api

This section contains HTTP API reference docs for Bluesky and AT Protocol lexicons. Generate a bearer token to test API calls directly from the docs.

It's not clear how to use a generated bearer token directly from the reference docs.

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

No branches or pull requests

4 participants