PHPackages                             bearsys/steam - 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. bearsys/steam

ActiveLibrary

bearsys/steam
=============

Package combining several Steam-related libraries into one wrapped and easy-to-use package.

09PHP

Since Feb 11Pushed 8y agoCompare

[ Source](https://github.com/BearSysCZ/Steam)[ Packagist](https://packagist.org/packages/bearsys/steam)[ RSS](/packages/bearsys-steam/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Steam libraries
===================

[](#php-steam-libraries)

This package combines several useful PHP libraries for working with Steam IDs, Steam Web API and Steam oAuth.

Can be used standalone or as Nette framework extension.

Package currently includes these libraries:

- [`Ehesp/Steam-Login`](https://github.com/Ehesp/Steam-Login) - used for Nette login component
- [`xPaw/SteamID`](https://github.com/xPaw/SteamID.php) - used for conversions of Steam IDs
- [`zyberspace/php-steam-web-api-client`](https://github.com/zyberspace/php-steam-web-api-client) - used for querying Steam Web API

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

[](#installation)

```
composer require bearsys/steam

```

Usage
-----

[](#usage)

Note that Valve limits requests to this API (if you don't have publisher's key). There should be daily limit of 100,000 requests. That is 69 requests per minute. But you could probably make all 100,000 requests at once, although it is not recommended.

### Standalone

[](#standalone)

Create instance of `BearSys\Steam\SteamWrapper`, provide you Steam Web API user key as constructor parameter.

You can then work with this wrapper as you wish.

#### Example:

[](#example)

```
$apiKey = 'KEY_GOES_HERE'; // Your API key, matches regex ^[0-9A-F]{32}$
$wrapper = new BearSys\Steam\SteamWrapper($apiKey);

$user = $wrapper->getUser('hitzor'); // you could use any form of Steam ID or vanity URL
$user->getInfo(); // returns info about selected user

$game = $wrapper->getGame(730); // 730 is CS:GO's AppID
$game->getActivePlayersCount(); // returns how many players are currently playing
```

### Nette framework

[](#nette-framework)

Register extension in your config and set Steam Web API key.

```
extensions:
    steam: BearSys\Steam\Bridges\NetteDI\SteamExtension

steam:
    apiKey: # your Steam Web API key goes here
```

You can request SteamWrapper after that in every class that is created using Nette DI.

#### Login component

[](#login-component)

Extension will register login factory. Inject it into your presenter (or any other component) and use it's setup method to set callbacks.

```
/** @var BearSys\Steam\Bridges\NetteApplication\SteamLoginFactory @inject */
public $loginFactory;
// you could use any suitable injection method, this is just the example

public function createComponentSteamLogin()
{
	$successCallback = function (string $steamId, bool $registered) {
		if ($registered)
			$this->redirect('this');
		else
			$this->redirect('User:signUpSteam', $steamId);
	};

	$failureCallback = function (\Exception $e) {
		// log $e
	};

	return $this->loginFactory->setup(
		function (SteamLogin $login) use ($successCallback, $failureCallback) {
			$this->steamAuthenticator->login($login, $successCallback, $failureCallback);
		}
	);
}
```

Then you need to handle login inside your own authenticator. You could also do that inside your callback and then just call `Nette\Security\User::login()` method with `Nette\Security\IIdentity` instance, but we recommend to don't do that.

```
use Ehesp\SteamLogin\SteamLogin;

class SteamAuthenticator extends AbstractAuthenticator
{
	public function login(SteamLogin $login, callable $success, callable $failure)
	{
		try {
			$steamId = $login->validate(); // if this failed, it will throw an exception

			/*
			 * Your custom logic goes here.
			 *
			 * You will probably want to check, if Steam ID is in database.
			 * If it is, then just login associated user.
			 * If it isn't, then create user and redirect him to sign-up page
			 * with pre-filled username from Steam (obtainable using SteamWrapper).
			 */

			$success($steamId, $registered);
		} catch (\Exception $e) {
			// Login attempt failed
			$failure($e);
		}
	}
}
```

At last, create link to component handle and style it however you want.

```
Steam login
```

Future plans
------------

[](#future-plans)

- Tests (ASAP)
- Integrate `koraktor/steam-condenser-php`
- Add support for Symfony, Laravel and other frameworks (pull-requests are welcomed)
- Consider supporting Steamworks publisher's API endpoints

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

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/877b22c7add00cc5d4d6015a280b97ba8a1e49474fac0259ef4b378b728420a4?d=identicon)[markfrydrych](/maintainers/markfrydrych)

---

Top Contributors

[![markfrydrych](https://avatars.githubusercontent.com/u/20677808?v=4)](https://github.com/markfrydrych "markfrydrych (7 commits)")

### Embed Badge

![Health badge](/badges/bearsys-steam/health.svg)

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

PHPackages © 2026

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