PLhery / node-twitter-api-v2

Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
https://www.npmjs.com/package/twitter-api-v2
Apache License 2.0
1.29k stars 176 forks source link

A small error inside the documentation #394

Closed atharva123a closed 1 year ago

atharva123a commented 1 year ago

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>');
alkihis commented 1 year ago

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.