PitchHut logo
Simplifying X (Twitter) API integration for Laravel applications.
Pitch

Plume offers a robust X (Twitter) API v2 client tailored for Laravel, featuring clean facades, typed DTOs, and user-scoped operations. With built-in test fakes, OAuth auto-refresh, and an extensive collection of artisan commands, developers can seamlessly integrate and interact with the X API while enjoying an enhanced development experience.

Description

Plume - The Comprehensive X (Twitter) API v2 Client for Laravel

Plume serves as a robust client for the X (formerly Twitter) API v2, built specifically for Laravel. It encapsulates the entire API's functionality behind an elegant facade, allowing developers to seamlessly integrate X API features into their applications. With features such as typed Data Transfer Objects (DTOs), automatic pagination, and user-scoped operations, Plume enhances the development experience by providing a structured and user-friendly interface.

Plume — X API v2 Client for Laravel

Key Features

  • Full X API v2 Support: Unlike many existing libraries that only integrate with older API versions, Plume is designed for the latest features of the X API v2.
  • Laravel Facades: Provides a clean, Laravel-native interface for easy access to API methods.
  • Typed DTOs: Ensures type safety and improves code readability by utilizing typed objects for API responses.
  • Automatic Pagination: Streamlines the process of fetching paginated results without manual intervention.
  • OAuth 2.0 with Auto-Refresh: Simplifies authentication handling by automatically refreshing tokens as needed.
  • Rate-Limit Management: Features structured handling for rate limits, allowing for smoother API interactions.
  • Extensive Testing Tools: Facilitates development with test fakes that support semantic assertions, enabling robust testing workflows.
  • CLI Access: Includes 41 artisan commands for comprehensive command-line interface support, enhancing developer productivity.
  • AI Tools Integration: Ships with 15 tools tailored for the Laravel AI SDK, expanding functionality into AI-driven applications.

Usage Examples

Creating a Post:

use Plume;
$post = Plume::createPost('Hello from Plume!');

Searching Recent Tweets:

$results = Plume::searchRecent('laravel');
foreach ($results->data as $post) {
    echo "{
    $post->text\n";
}

Fetching User Profile:

$me = Plume::me();
echo $me->publicMetrics->followersCount;

Comprehensive Coverage

Plume is designed to cover every endpoint in the X API v2, ensuring developers have access to all necessary features including posts, user timelines, likes, retweets, bookmarks, and more. Each method is fully typed, providing a clear contract for usage.

Getting Started

Plume is simple to incorporate into your Laravel application. It requires PHP 8.2+ and is compatible with Laravel versions 11 and 12.

For installation, add with Composer and update your .env for authentication:

composer require jkudish/plume

Conclusion

Plume positions itself as the definitive X API package for Laravel, focusing on modern development needs with its rich set of features aimed at improving developer experience and application performance. For detailed instructions on contributions or managing vulnerabilities, please refer to CONTRIBUTING.md and SECURITY.md.

For further information and detailed usage instructions, visit the official repository.

0 comments

No comments yet.

Sign in to be the first to comment.