-
Notifications
You must be signed in to change notification settings - Fork 553
Open
Description
I am trying to log in to post tweets on behalf of my own account from my app. I have not been able to move past the following error:
{ errors: [ { code: 32, message: 'Could not authenticate you.' } ] }
Previously I was using a different Twitter client which had issues with authentication and how my keys were generated.
The following is my code that fails to authenticate.
// /utils/twitterConfig.js
module.exports = {
consumer_key: process.env.TWITTER_API_KEY,
consumer_secret: process.env.TWITTER_API_SECRET,
access_token: process.env.TWITTER_ACCESS_TOKEN,
access_token_secret: process.env.TWITTER_ACCESS_SECRET,
};
// index.js
import twitterConfig from "../utils/twitterConfig";
import twit from "twit";
...
const Twitter = new twit(twitterConfig);
const tweets = Twitter.get(
"search/tweets",
{ q: "banana since:2011-07-11", count: 100 },
function (err, data, response) {
console.log(data);
}
);
Any idea what's going on here?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels