Getting the following error -

I do have elevated access

I’m using the following

  • Node js v16.13.1
  • twitter-api-v2 sdk from NPM

Code snippet -

require('dotenv').config();
const { TwitterApi } = require('twitter-api-v2');

const client = new TwitterApi({
  appKey,
  appSecret: ,
  accessToken,
  accessTokenSecret,
});

const rwClient = client.readWrite;

module.exports = { rwClient, client };

index.js file

require('dotenv').config();

const { rwClient, client } = require('./lib/twitterClient.js');

const tweet = async () => {
  try {
    console.log('tweeting...');

    await rwClient.v1.tweet('Hello, world!');

    console.log('tweeted!');
  } catch (err) {
    console.log(err);
  }
};

tweet();

Is read write access set in the developer dashboard and regenerated after being set to read and write?

Yes I did
Still the same issue

I’m using ngrok to redirect any callbacks, is it because of that?

Tried it using a standalone app as well, but the same result

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.