PHPackages                             goldendeveloper/battlenet - 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. goldendeveloper/battlenet

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

goldendeveloper/battlenet
=========================

BattleNet OAuth2 Provider for Laravel Socialite

10PHPCI passing

Since Jun 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Golden-Developer/Socialite-Battelnet-oAuth)[ Packagist](https://packagist.org/packages/goldendeveloper/battlenet)[ RSS](/packages/goldendeveloper-battlenet/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Socialite-BattleNet
===================

[](#socialite-battlenet)

BattleNet provider for Laravel Socialite/Socialite Providers.

Install
-------

[](#install)

Composer:

`composer require goldendeveloper/battlenet`

Same procedure as any other SocialiteProviders package. Add the event handler to the Socialite Providers array:

```
'Goldendeveloper\SocialiteProviders\BattleNet\BattleNetExtendSocialite@handle',

```

Place your environment variables in your `.env.`:

```
BATTLENET_KEY=client_id
BATTLENET_SECRET=client_secret
BATTLENET_REDIRECT_URI=https://example.com/login

```

Now you have two options when using the provider.

Usage (Socialite-way)
---------------------

[](#usage-socialite-way)

Now you can use the provider like so. The session flashing is only required if you need to use a BattleNet region other than `us`:

```
// redirect route
Session::put('bnet.region', 'eu');
return Socialite::with('battlenet')->redirect();

// callback route
$user = Socialite::driver('battlenet')->user();
$accountId = $user->getId(); // bnet accountId
$battletag = $user->getNickname(); // bnet battletag

```

Usage (Laravel-way)
-------------------

[](#usage-laravel-way)

If you'd like to avoid flashing to the session yourself, you can use the included facade that manages it for you.

Install service provider:

```
Goldendeveloper\SocialiteProviders\BattleNet\BattleNetServiceProvider::class,

```

Install facade:

```
'BattleNet' => Goldendeveloper\SocialiteProviders\BattleNet\BattleNetFacade::class,

```

Now you can simply use the facade. The region defaults to `us`, so you don't even need to pass it through:

```
// redirect route
return BattleNet::redirect('eu');

```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 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/b0bda7b236c86adaf4346b90cc248d12d42d935fd34d1732c25a41d8684893ee?d=identicon)[Coho04](/maintainers/Coho04)

---

Top Contributors

[![Coho04](https://avatars.githubusercontent.com/u/73216313?v=4)](https://github.com/Coho04 "Coho04 (11 commits)")

---

Tags

golden-developerphp

### Embed Badge

![Health badge](/badges/goldendeveloper-battlenet/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

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

41721.2M117](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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