PHPackages                             socialiteproviders/threads - 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. socialiteproviders/threads

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

socialiteproviders/threads
==========================

Threads OAuth2 Provider for Laravel Socialite

4.0.0(2y ago)324.2k↓33.8%1MITPHPPHP ^8.0

Since Jun 22Pushed 4mo ago3 watchersCompare

[ Source](https://github.com/SocialiteProviders/Threads)[ Packagist](https://packagist.org/packages/socialiteproviders/threads)[ RSS](/packages/socialiteproviders-threads/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Threads
=======

[](#threads)

```
composer require socialiteproviders/threads
```

Installation &amp; Basic Usage
------------------------------

[](#installation--basic-usage)

Please see the [Base Installation Guide](https://socialiteproviders.com/usage/), then follow the provider specific instructions below.

### Add configuration to `config/services.php`

[](#add-configuration-to-configservicesphp)

```
'threads' => [
  'client_id' => env('THREADS_CLIENT_ID'),
  'client_secret' => env('THREADS_CLIENT_SECRET'),
  'redirect' => env('THREADS_REDIRECT_URI')
],
```

### Add provider event listener

[](#add-provider-event-listener)

#### Laravel 11+

[](#laravel-11)

In Laravel 11, the default `EventServiceProvider` provider was removed. Instead, add the listener using the `listen` method on the `Event` facade, in your `AppServiceProvider` `boot` method.

- Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.

```
Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
    $event->extendSocialite('threads', \SocialiteProviders\Threads\Provider::class);
});
```

Laravel 10 or below Configure the package's listener to listen for `SocialiteWasCalled` events. Add the event to your `listen[]` array in `app/Providers/EventServiceProvider`. See the [Base Installation Guide](https://socialiteproviders.com/usage/) for detailed instructions.

```
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\Threads\ThreadsExtendSocialite::class.'@handle',
    ],
];
```

### Usage

[](#usage)

You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):

```
return Socialite::driver('threads')->redirect();
```

### Returned User fields

[](#returned-user-fields)

- `id`
- `nickname`
- `avatar`

### Refreshing access tokens

[](#refreshing-access-tokens)

Threads does not support refresh tokens. It is however possible to exchange the default short-lived access tokens for long-lived refreshable access tokens. Socialite only supports the conventional way of refreshing access token with refresh tokens, so you need to implement this in your own code if you need to refresh access tokens.

First, exchange a short-lived access token for a long-lived access token.

```
public function exchangeAccessToken(string $accessToken): string
{
    $response = Http::post('https://graph.threads.net/access_token', [
            RequestOptions::HEADERS => [
                'Content-Type' => 'application/json'
            ],
            RequestOptions::FORM_PARAMS => [
                'access_token'  => $accessToken,
                'client_secret' => config('threads.client_secret'),
                'grant_type'    => 'th_exchange_token',
            ],
        ]);

    $response = json_decode((string) $response->getBody(), true);

    return $response['access_token'];
}
```

After obtaining a long-lived access token, this token can be refreshed as long as it's still valid.

```
public function refreshAccessToken(string $accessToken): string
{
    $response = Http::post('https://graph.threads.net/refresh_access_token', [
            RequestOptions::HEADERS => [
                'Content-Type' => 'application/json'
            ],
            RequestOptions::FORM_PARAMS => [
                'access_token'  => $accessToken,
                'grant_type'    => 'th_refresh_token',
            ],
        ]);

    $response = json_decode((string) $response->getBody(), true);

    return $response['access_token'];
}
```

### Reference

[](#reference)

- [Threads API](https://developers.facebook.com/docs/threads)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance52

Moderate activity, may be stable

Popularity32

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

741d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65eb3a7ba2a2c13b3a9de48b836caf759ad4052f9a839e30464c80d177d5b3d2?d=identicon)[atymic](/maintainers/atymic)

---

Top Contributors

[![lucasmichot](https://avatars.githubusercontent.com/u/513603?v=4)](https://github.com/lucasmichot "lucasmichot (3 commits)")[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (2 commits)")[![Akmalfauzi](https://avatars.githubusercontent.com/u/47932109?v=4)](https://github.com/Akmalfauzi "Akmalfauzi (1 commits)")[![maks-oleksyuk](https://avatars.githubusercontent.com/u/90793591?v=4)](https://github.com/maks-oleksyuk "maks-oleksyuk (1 commits)")[![nickbeen](https://avatars.githubusercontent.com/u/66799549?v=4)](https://github.com/nickbeen "nickbeen (1 commits)")

---

Tags

laraveloauthoauth1oauth2social-mediasocialitesocialite-providerslaravelprovideroauthsocialitethreads

### Embed Badge

![Health badge](/badges/socialiteproviders-threads/health.svg)

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

###  Alternatives

[socialiteproviders/apple

Apple OAuth2 Provider for Laravel Socialite

629.5M15](/packages/socialiteproviders-apple)[socialiteproviders/microsoft

Microsoft OAuth2 Provider for Laravel Socialite

347.3M25](/packages/socialiteproviders-microsoft)[socialiteproviders/instagram

Instagram OAuth2 Provider for Laravel Socialite

402.0M5](/packages/socialiteproviders-instagram)[socialiteproviders/saml2

SAML2 Service Provider for Laravel Socialite

172.6M5](/packages/socialiteproviders-saml2)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

24133.4k](/packages/kovah-laravel-socialite-oidc)[socialiteproviders/kakao

Kakao OAuth2 Provider for Laravel Socialite

10510.1k6](/packages/socialiteproviders-kakao)

PHPackages © 2026

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