node-twitter-api-v2 icon indicating copy to clipboard operation
node-twitter-api-v2 copied to clipboard

[doc] misleading

Open guiyumin opened this issue 9 months ago • 3 comments

Describe the bug the doc shows: const twitterClient = new TwitterApi('<YOUR_APP_USER_TOKEN>'); it's misleading

To Reproduce N/A

Expected behavior

const twitterClient = new TwitterApi({
  appKey: process.env.TWITTER_CONSUMER_API_KEY,
  appSecret: process.env.TWITTER_CONSUMER_API_SECRET,
  accessToken: process.env.TWITTER_ACCESS_TOKEN,
  accessSecret: process.env.TWITTER_ACCESS_SECRET,
});

this one works I hope the doc can be updated

Version N/A

Additional context N/A

guiyumin avatar Mar 04 '25 17:03 guiyumin

In Twitter Api V2, you have the ability to generate a single "bearer token", so you can use both ways

plhery avatar Mar 04 '25 17:03 plhery

In Twitter Api V2, you have the ability to generate a single "bearer token", so you can use both ways

I tried to use the bearer token generated here, but it did not work.

would you point me the direction where i can get the correct bearer token? Thank you very much!

Image

guiyumin avatar Mar 04 '25 20:03 guiyumin

When you say it doesn't work, can you clarify what happens/which error? It is supposed to work, and used to work at least.

plhery avatar Sep 04 '25 22:09 plhery