
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@cammyleone/twitter-api-v2
Advanced tools
Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
Main maintainer: @alkihis - 
✅ Ready for v2 and good ol' v1.1 Twitter API
✅ Light: No dependencies, 17kb minified+gzipped
✅ Bundled types for request parameters and responses
✅ Streaming support
✅ Pagination utils
✅ Media upload helpers
Install it through your favorite package manager:
yarn add twitter-api-v2
# or
npm i twitter-api-v2
Here's is a quick example of usage:
import TwitterApi from 'twitter-api-v2';
// Instanciate with desired auth type (here's Bearer v2 auth)
const twitterClient = new TwitterApi('<YOUR_APP_USER_TOKEN>');
// Tell typescript it's a readonly app
const roClient = twitterClient.readOnly;
// Play with the built in methods
const user = await roClient.v2.userByUsername('plhery');
await twitterClient.v1.tweet('Hello, this is a test.');
// You can upload media easily!
await twitterClient.v1.uploadMedia('./big-buck-bunny.mp4');
Sometimes, you just want to quickly bootstrap an application using the Twitter API. Even if they're a lot of available libraries on the JavaScript ecosystem, they usually just provide wrappers around HTTP methods, and some of them are bloated with many dependencies.
twitter-api-v2 meant to provide full endpoint wrapping, from method name to response data,
using descriptive typings for read/write/DMs rights, request parameters and response payload.
A small feature comparaison with other libs:
*No support for media/upload, cannot send a multipart/form-data encoded-body without tricks
Here's the detailed feature list of twitter-api-v2:
GET, POST, PUT, DELETE and PATCH),
that handle query string parse & format, automatic body formatting and moreAnd last but not least, fully powered by native Promises.
Learn how to use the full potential of twitter-api-v2.
FAQs
Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
The npm package @cammyleone/twitter-api-v2 receives a total of 6 weekly downloads. As such, @cammyleone/twitter-api-v2 popularity was classified as not popular.
We found that @cammyleone/twitter-api-v2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.