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

@maiar-ai/plugin-x

v1.0.0

Published

Maiar: A Composable, Plugin-Based AI Agent Framework

Readme

@maiar-ai/plugin-x

This package is part of the Maiar ecosystem, designed to work seamlessly with @maiar-ai/core.

Documentation

For detailed documentation, examples, and API reference, visit: https://maiar.dev/docs

Configuration

The X plugin requires the following configuration:

interface XPluginConfig {
  // OAuth2 Authentication
  client_id: string;
  client_secret?: string; // Only required for confidential clients
  callback_url: string;
  bearer_token?: string; // For app-only authentication
}

Required Configuration

  • client_id: Your X API OAuth 2.0 client ID (from X Developer Portal)
  • callback_url: Your OAuth callback URL (e.g., http://localhost:3000/callback)
  • client_secret: Your X API client secret (required for confidential clients)

Important: The plugin now strictly requires these configuration parameters to be present. If they are missing, the plugin will throw an error and halt application execution. Make sure to properly configure these values before using the plugin.

Plugin Information

Actions

  • post_tweet: Post a new tweet (not a reply). Used when you want to post a new tweet that is not in response to another tweet.

Triggers

  • mentions: Monitors and processes mentions of the configured X account. Automatically checks for new mentions at configured intervals and handles user interactions.

For more detailed examples and advanced usage, visit our documentation.

Maiar X Plugin

A plugin for the Maiar AI agent framework to interact with the X (Twitter) API.

Authentication with X API

This plugin provides an interactive authentication flow to connect with the X API. The process uses OAuth 2.0 to securely authenticate and authorize your application.

Prerequisites

  1. Create a project/app in the X Developer Portal
  2. Configure your app with:
    • OAuth 2.0 authentication
    • A localhost callback URL (e.g., http://localhost:3000/callback)
    • Read/Write permissions

Setup

Edit your .env file with your X API credentials from the developer portal.

Authentication Process

The plugin handles authentication automatically during initialization:

  1. When the plugin initializes, it checks for existing stored credentials
  2. If no valid token is found, it automatically starts the authentication flow
  3. You'll be guided through the X API authentication process interactively
  4. After authentication is complete, the plugin will continue initialization

If authentication fails at any point:

  1. The plugin will throw an error with a detailed message
  2. Your application will halt execution, preventing it from running with invalid credentials
  3. You'll need to restart your application after fixing the configuration or running manual authentication

You can also manually trigger authentication at any time:

pnpm maiar-x-login

This allows you to update the token if needed or redo the authentication with different credentials.

The authentication flow will:

  1. Generate an authorization URL for you to open in your browser
  2. Guide you through the authentication process with X
  3. Allow you to paste the callback URL after authorization
  4. Exchange the code for an access token and store it securely
  5. Test the connection to ensure everything works

Token Persistence

Authentication tokens are stored securely in the ./data/x-oauth-token file in your project directory. Tokens will be reused between application restarts, and the plugin automatically handles token refreshing when needed.

Troubleshooting

  • Application stops with "Missing required configuration" error: The plugin now strictly requires the client_id, client_secret, and callback_url parameters. Make sure to set these in your configuration or environment variables before starting the application.
  • Authentication failed: Make sure your callback URL exactly matches what's configured in your X Developer Portal.
  • Code expired: Authorization codes expire quickly. Complete the process within a few minutes.

Posting to X

After authenticating, you can use the service to post tweets.