npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@virtuals-protocol/game-twitter-node

v0.1.4

Published

Strongly typed, full-featured, light, versatile yet powerful Virtual Twitter API v2 client for Node.js. Forked from twitter-api-v2.

Downloads

1,303

Readme

@virtuals-protocol/game-twitter-node

Strongly typed, full-featured, light, versatile yet powerful Virtual Twitter API v2 client for Node.js, specifically designed for GAME Virtuals Protocol.

This is a fork of the original twitter-api-v2 library, modified to support Virtual Twitter API v2 endpoints within the GAME Virtuals Protocol ecosystem.

Important Note

This is a modified version of the original twitter-api-v2 library that focuses exclusively on Virtual Twitter API v2 support for GAME Virtuals Protocol. This implementation provides a virtualized Twitter API experience while maintaining compatibility with the v2 endpoint structure.

Highlights

Ready for Virtual Twitter API v2

Light: No dependencies, 23kb minified+gzipped

Bundled types for request parameters and responses

Streaming support

Pagination utils

GAME Virtuals Protocol integration

How to use

Install it through your favorite package manager:

yarn add @virtuals-protocol/game-twitter-node
# or
npm i @virtuals-protocol/game-twitter-node

Here's a quick example of usage:

import { TwitterApi } from "@virtuals-protocol/game-twitter-node";

// Instantiate with GAME Virtuals Protocol authentication
const twitterClient = new TwitterApi({
  gameTwitterAccessToken: "<YOUR_GAME_VIRTUALS_TOKEN>",
});

// Tell typescript it's a readonly app
const readOnlyClient = twitterClient.readOnly;

// Play with the built in methods
const user = await readOnlyClient.v2.userByUsername("plhery");
await twitterClient.v2.tweet("Hello, this is a test.");

To get the access token, run the following command:

npx @virtuals-protocol/game-twitter-node auth -k <GAME_API_KEY>

Here is an example run:

npx @virtuals-protocol/game-twitter-node auth -k apt-xxxxxxxxxx

You will see the following output:

Waiting for authentication...

Visit the following URL to authenticate:
https://x.com/i/oauth2/authorize?response_type=code&client_id=VVdyZ0t4WFFRMjBlMzVaczZyMzU6MTpjaQ&redirect_uri=http%3A%2F%2Flocalhost%3A8714%2Fcallback&state=866c82c0-e3f6-444e-a2de-e58bcc95f08b&code_challenge=K47t-0Mcl8B99ufyqmwJYZFB56fiXiZf7f3euQ4H2_0&code_challenge_method=s256&scope=tweet.read%20tweet.write%20users.read%20offline.access

After authenticating, you will receive the following message:

Authenticated! Here's your access token:
apx-613f64069424d88c6fbf2e75c0c80a34

Features

Here's everything @virtuals-protocol/game-twitter-node can do:

Basics:

  • Full support for Virtual Twitter API v2
  • Make signed HTTP requests with GAME Virtuals Protocol Authentication
  • Helpers for numerous HTTP request methods (GET, POST, PUT, DELETE and PATCH), that handle query string parse & format, automatic body formatting and more
  • High-class support for stream endpoints, with easy data consumption and auto-reconnect on stream errors

Request helpers:

  • Automatic paginator for endpoints like user and tweet timelines, allowing payload consumption with modern asynchronous iterators
  • Convenient methods for GAME Virtuals Protocol authentication
  • Dedicated methods that wrap Virtual API v2 endpoints, with typed arguments and fully typed responses
  • Typed errors, meaningful error messages, and error enumerations

Type-safe first:

  • Typings for tweet, user, media entities (and more) are bundled!
  • Type-safe wrapping of dedicated methods in 3 right level: DM/Read-write/Read-only
  • Declare a read-only client - you will only see the methods associated with read-only endpoints

And last but not least, fully powered by native Promises.