I have been trying to play around with Twitter API and using the npm i twitter-lite library. I want for others to post something through my website when they click on post and sign in, however, it only posts to my developer account. The following is my code:
const config = require('./config');
const twitter = require('twitter-lite');
const client = new twitter(config);
client
.getRequestToken("website")
.then(res =>
console.log({
reqTkn: res.oauth_token,
reqTknSecret: res.oauth_token_secret
})
)
.catch(console.error);
client.post('statuses/update', { status: 'testing' }).then(result => {
console.log('You successfully tweeted this : "' + result.text + '"');
}).catch(console.error);
Appreciate any advice.