- How do I install the socialiteproviders/streamelements package in Laravel?
- Install it with Composer using composer require socialiteproviders/streamelements. Then register the SocialiteWasCalled listener in your event service provider and add a services.streamelements block with your client ID, secret, and redirect URI. Finally, add a redirect route that calls Socialite::driver('streamelements')->redirect(). The package ships no migrations or publishable config, so setup is entirely additive.
- Which Laravel, PHP, and Socialite versions does this StreamElements provider support?
- The 5.x line is aligned with the current SocialiteProviders manager generation and assumes Laravel 10, 11, or 12 alongside laravel/socialite and socialiteproviders/manager. The published release notes do not include an explicit support matrix, so confirm PHP and Socialite constraints in the package's composer.json before committing. Treat the major version as tracking the manager and Socialite majors rather than as an independent stability guarantee.
- How do I configure StreamElements OAuth credentials for Socialite?
- Add a streamelements entry to config/services.php containing your client_id, client_secret, and redirect value, populated from environment variables. The provider reads those keys through the standard Socialite services configuration, so no separate config file needs publishing. Keep the credentials out of version control and set the redirect URI to the exact callback route registered in your StreamElements application.
- How do I register the SocialiteWasCalled event listener?
- Add a listener for SocialiteProviders\Manager\Events\SocialiteWasCalled in your app's EventServiceProvider and point it at the StreamElementsExtendSocialite handler the package provides. Without that listener, Socialite::driver('streamelements') will not resolve and you will get an unsupported driver error. Removing the listener and the Composer requirement fully unwinds the integration.
- What user data does the StreamElements provider return from mapUserToObject?
- The provider converts the OAuth callback into a Laravel\Socialite\Contracts\User, typically exposing an id, nickname or display name, email if the API returns one, and the raw response payload via getRaw(). Because StreamElements profile data may change between releases, read only the fields you actually need and keep a defensive null check around optional values. Wrap the provider behind your own connector interface so a field rename in mapUserToObject never leaks into domain code.
- Does this package handle refresh tokens and token expiry for StreamElements?
- Expect the adapter to focus on the authorization code exchange and user lookup rather than long-lived token lifecycle management. Storing access and refresh tokens, refreshing them before expiry, and revoking on logout remain your responsibility unless the provider explicitly implements it. Check the Provider class source for a refreshToken method before designing your token storage.
- What changed in version 5.1.0 of socialiteproviders/streamelements?
- The 5.1.0 release notes contain only an auto-generated compare link, with no changelog body, PR summary, or migration notes. Before upgrading from 5.0.0, diff the src directory between the two tags to see whether scopes, endpoints, or the user mapping shape changed. Treat the tag as unverified until that diff has been reviewed.
- How do I obtain StreamElements OAuth client credentials for my app?
- You need to register an application with StreamElements and receive a client ID, client secret, and an approved redirect URI before any code will work. StreamElements does not publish a broadly documented, versioned public OAuth API for third parties the way Google or GitHub do, so access may depend on a partner agreement or creator-facing approval. Confirm early that your use case is permitted, because that approval step usually takes longer than the integration itself.
- What are the main production risks of using this StreamElements provider?
- The biggest risk is upstream API stability: the provider may target endpoints that are undocumented or partner-specific, so a change can break login with no deprecation window. Secondary risks include silent behaviour changes in minor releases with empty changelogs and the broader maintenance concentration across the SocialiteProviders split packages. Mitigate by pinning versions, wrapping the vendor class behind your own interface, and monitoring the login flow in production.
- How do I test StreamElements authentication without hitting the real API?
- The package ships no test helpers, so the practical approach is to mock the provider or fake the underlying HTTP responses in your feature tests. Because the adapter is a thin OAuth 2.0 layer, most of your logic lives in your own callback handler, which you can test against a stubbed Socialite user. Keeping a connector interface in front of the vendor class makes swapping in a fake for tests straightforward.