Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Reddit Laravel Package

socialiteproviders/reddit

Reddit OAuth provider for Laravel Socialite. Adds Reddit login to your Laravel app using Socialite, supporting OAuth2 authentication with minimal setup. Install via Composer and configure your Reddit client ID and secret.

View on GitHub
Deep Wiki
Context7

[READ ONLY] Subtree split of the SocialiteProviders/Reddit Provider (see SocialiteProviders/Providers)

Frequently asked questions about Reddit
How do I install socialiteproviders/reddit in a Laravel app?
Run composer require socialiteproviders/reddit, which pulls in socialiteproviders/manager as a hard dependency alongside laravel/socialite. Add your Reddit client ID and secret to config/services.php under a reddit key, then register the SocialiteWasCalled event listener so the provider is bootstrapped. Finally add a callback route that your controller handles. For a team already running Socialite this is typically a few hours of work, not days.
How do I configure Reddit client credentials and the callback URL in Laravel?
Create an app in Reddit's developer settings to get a client ID and secret, then add them to config/services.php with a redirect URI that matches your route exactly. Register one redirect URI per environment, because Reddit compares the value character for character and a mismatch is the most common first-integration failure. Each environment needs its own Reddit app or carefully registered URIs, since the package has no multi-tenant credential handling out of the box.
Should I register the Reddit provider with SocialiteWasCalled or Socialite::extend?
Both work, but the event-listener style using the SocialiteWasCalled event is the maintained path and should be preferred. Socialite::extend is available if you need explicit registration in a service provider, but it bypasses the manager's conventions. The package itself only supplies a provider class and a listener, so it does not touch your routes, sessions, or user tables.
Which Laravel, Socialite, and PHP versions does socialiteproviders/reddit support?
The package is a thin adapter, so its real constraints come from its two upstream dependencies: laravel/socialite and socialiteproviders/manager. Check the composer.json of the exact tagged release to confirm the allowed major versions match your locked Socialite version, and verify the PHP floor against your runtime. Socialite has seen major-version churn in recent years, so this constraint check is the most common source of upgrade friction rather than the provider code itself.
Why do I get a redirect_uri mismatch error when logging in with Reddit?
Reddit requires the redirect URI sent in the authorize request to exactly match one registered in your Reddit app settings, including scheme, host, trailing slash, and port. The usual culprits are a localhost port that differs from what you registered, an http versus https mismatch, or a staging app reusing the production URI. Register each environment's callback explicitly and clear your config cache after changing services.php.
Does socialiteproviders/reddit let me access subreddits, post content, or moderate?
No. This package authenticates a Reddit identity through OAuth2 and returns the user via Socialite; it does not wrap the Reddit Data API. Any feature involving subreddit content, posting, voting, or moderation is a separate integration with its own terms, quotas, and rate limits. State that scope boundary up front so stakeholders do not assume login support implies API access.
How do Reddit access token expiry and refresh tokens work with this provider?
Reddit access tokens are short-lived, and refresh tokens are only issued when the authorization request includes duration=permanent. Whether the provider requests that parameter and exposes the refresh token should be confirmed in the provider source or release notes before you rely on long-lived sessions. A regression in refresh handling tends to surface as intermittent session expiry rather than a hard failure, which makes it easy to miss in QA.
Is socialiteproviders/reddit safe to use in production?
It is a community-maintained subtree split with uneven release cadence, so treat it as a small, reviewable dependency rather than a managed service. Pin the version, read the diff before bumping, and monitor Reddit login failures separately from the rest of your auth path, since the blast radius is limited to Reddit users. Note that the 4.2.0 release notes contain only a compare link, so read the actual diff between 4.1.0 and 4.2.0 before treating that version as validated. Reddit's own API and OAuth terms have also changed repeatedly and no package version can protect you from an external policy shift.
How do I test Reddit login in Laravel without calling Reddit?
Mock Socialite in your tests with Socialite::shouldReceive to return a fake user object, so the callback controller can be exercised without a real OAuth round trip. Alternatively fake the outbound HTTP calls to Reddit's token endpoint and assert on the redirect and session behaviour. Keep at least one manual smoke test against a real Reddit app per environment, because the redirect URI mismatch class of bug only appears in the live flow.
What is the alternative to socialiteproviders/reddit?
Laravel Socialite does not ship a built-in Reddit driver, so the options are this provider, a hand-written driver registered with Socialite::extend, or a different auth package entirely. This package is the conventional choice because it is the subtree split of the SocialiteProviders Reddit provider and plugs into the manager contract with one class and one listener. If Socialite is not already in your stack, adopt Socialite first; this package is the wrong entry point on its own.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core