PHPackages                             defiant/twitterappauth - 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. defiant/twitterappauth

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

defiant/twitterappauth
======================

PHP class for Twitter's Application-only authentication model

071PHP

Since Aug 14Pushed 12y ago1 watchersCompare

[ Source](https://github.com/defiant/twitterAppAuth)[ Packagist](https://packagist.org/packages/defiant/twitterappauth)[ RSS](/packages/defiant-twitterappauth/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

twitterAppAuth
==============

[](#twitterappauth)

PHP class for Twitter's Application-only authentication model
-------------------------------------------------------------

[](#php-class-for-twitters-application-only-authentication-model)

Twitter offers applications the ability to issue authenticated requests on behalf of the application itself (as opposed to on behalf of a specific user). As Twitter API 1.1 requires almost all calls to be authenticated getting info from Twitter for your app you need some way to authenticate requests. This class implements this behaviour. This class does not authenticate a user. As Twitter says:

When issuing requests using application-only auth, there is no concept of a "current user." Therefore, endpoints such as POST statuses/update will not function with application-only auth. See [using OAuth](https://dev.twitter.com/docs/auth/using-oauth) for more information for issuing requests on behalf of a user.

More info can be found at

Currently only API Call function is `getUserInfo($username)`. This method is gets a user's information from twitter and acts as an example method.

```
// If you run the class first time
// supply your credentials
// Example:
$twitter = new twitterAppAuth();

//set keys
$twitter->consumerKey = 'YOUR_KEY';
$twitter->consumerSecret = 'YOUR_SECRET';

$user = $twitter->getUserInfo('sinantaga');

```

or if you saved your token from Twitter you can just supply the token. Because a bearer token is valid until you specifically invalidate it.

```
// If you run the class first time
// supply your token
// Example:
$twitter = new twitterAppAuth();

//set token you already have
$twitter->setToken('YOUR_BEARER_TOKEN');

$user = $twitter->getUserInfo('sinantaga');

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f0ee338536e2b9bb7a32c6f41a4808964b0d6159d81c1db0d6ead8fab65c5a5?d=identicon)[defiant](/maintainers/defiant)

---

Top Contributors

[![defiant](https://avatars.githubusercontent.com/u/89477?v=4)](https://github.com/defiant "defiant (9 commits)")

### Embed Badge

![Health badge](/badges/defiant-twitterappauth/health.svg)

```
[![Health](https://phpackages.com/badges/defiant-twitterappauth/health.svg)](https://phpackages.com/packages/defiant-twitterappauth)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
