twitter-fetch is a Node.js library for accessing the Twitter API.
It has a fetch-like implementation based on node-fetch.
Installation
npm i twitter-fetch
yarn add twitter-fetch
pnpm i twitter-fetch
Usage
import { OAuth1a } from 'twitter-fetch'
const client = new OAuth1a({
accessToken: 'your access token',
consumerKey: 'your consumer key',
secretAccessToken: 'your secret access token',
secretConsumerKey: 'your secret consumer key',
})
const response = await fetch(
`/1.1/statuses/update.json?status=${encodeURIComponent('Hello World')}`,
{ method: 'POST' }
)
console.log(await response.json())
Supports