Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
7.20.0 source code.tar.gz | 2025-07-17 | 92.0 kB | |
7.20.0 source code.zip | 2025-07-17 | 206.9 kB | |
README.md | 2025-07-17 | 2.3 kB | |
Totals: 3 Items | 301.2 kB | 1 |
- You can now get a user by their federated identity provider (e.g. Google, Facebook, etc.) UID with
Kreait\Firebase\Auth::getUserByProviderUid()
. (#1000).
Since this method couldn't be added to the Kreait\Firebase\Contract\Auth
interface without causing a breaking change, a new transitional interface/contract named Kreait\Firebase\Contract\Transitional\FederatedUserFetcher
was added. This interface will be removed in the next major version of the SDK.
There are several ways to check if you can use the getUserByProviderUid()
method:
:::php
use Kreait\Firebase\Contract\Transitional\FederatedUserFetcher;
use Kreait\Firebase\Factory;
$auth = (new Factory())->createAuth();
// The return type is Kreait\Firebase\Contract\Auth, which doesn't have the method
if (method_exists($auth, 'getUserByProviderUid')) {
$user = $auth->getUserByProviderUid('google.com', 'google-uid');
}
if ($auth instanceof \Kreait\Firebase\Auth) { // This is the implementation, not the interface
$user = $auth->getUserByProviderUid('google.com', 'google-uid');
}
if ($auth instanceof FederatedUserFetcher) {
$user = $auth->getUserByProviderUid('google.com', 'google-uid');
}
- The new method
Kreait\Firebase\Factory::withDefaultCache()
allows you to set a default cache implementation for the SDK. This is useful if you want to use one cache implementation for all components that support caching. (Documentation)
Deprecated
Kreait\Firebase\Factory::getDebugInfo
What's Changed
- Enable getting a user by their federated IdP UID by @jeromegamez in https://github.com/kreait/firebase-php/pull/1003
- Add and address PHPStan strict rules by @jeromegamez in https://github.com/kreait/firebase-php/pull/1006
- Add previous exceptions to api exceptions by @BackEndTea in https://github.com/kreait/firebase-php/pull/1008
New Contributors
- @BackEndTea made their first contribution in https://github.com/kreait/firebase-php/pull/1008
Full Changelog: https://github.com/kreait/firebase-php/compare/7.19.0...7.20.0