PHPackages                             smolblog/oauth2-twitter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. smolblog/oauth2-twitter

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

smolblog/oauth2-twitter
=======================

Twitter OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1.2.0(1y ago)17190.0k↑25%8[1 PRs](https://github.com/smolblog/oauth2-twitter/pulls)4BSD-3-ClausePHPPHP ^7.3 || ^8.0

Since Jun 8Pushed 1y ago4 watchersCompare

[ Source](https://github.com/smolblog/oauth2-twitter)[ Packagist](https://packagist.org/packages/smolblog/oauth2-twitter)[ RSS](/packages/smolblog-oauth2-twitter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (7)Used By (4)

Twitter Provider for OAuth 2.0 Client
=====================================

[](#twitter-provider-for-oauth-20-client)

This package provides Twitter OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

**As I (Evan) have closed all my X accounts, I can no longer verify this library's features myself. If you are willing to take maintenance of this library, please get in touch!**

Installation
------------

[](#installation)

To install, use composer:

```
composer require smolblog/oauth2-twitter

```

Usage
-----

[](#usage)

Usage is the same as The League's OAuth client, using `\Smolblog\OAuth2\Client\Provider\Twitter` as the provider.

### Authorization Code Flow

[](#authorization-code-flow)

```
