Note: For questions about how to use an endpoint, or problems related to Twitter API than the lib itself, please use the GitHub Discussions instead of opening a new issue.
The code block that states
The .loginWithOAuth2() method already returns a logged client, but if you want to create an instance by yourself with an access token (for example to make a request from a saved access token), use it as a Bearer token.
has a small mistake. It should specify that the method accepts a bearerToken instead of an accessToken as given inside the line of code that follows.
const client = new TwitterApi('<YOUR-ACCESS-TOKEN>');
should ideally be:
const client = new TwitterApi('<YOUR-BEARER-TOKEN>');
Hi,
Even if it is in fact a Bearer token, this is named access token to avoid confusion with App-only OAuth2 Bearer token, that is widely mentionned as it in the Twitter documentation.
Note: For questions about how to use an endpoint, or problems related to Twitter API than the lib itself, please use the GitHub Discussions instead of opening a new issue.
The code block that states
has a small mistake. It should specify that the method accepts a bearerToken instead of an accessToken as given inside the line of code that follows.
should ideally be: