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
Spotify Web Api Bundle

Spotify Web Api Bundle Laravel Package

calliostro/spotify-web-api-bundle

Symfony bundle that integrates jwilsson/spotify-web-api-php into Symfony 6.4, 7 and 8. Supports Client Credentials and Authorization Code flows, autowires Spotify API services, and offers a customizable token provider with simple configuration.

View on GitHub
Deep Wiki
Context7

Symfony bundle for the Spotify Web API — streaming, music data & integration made easy.

Frequently asked questions about Spotify Web Api Bundle
How do I install calliostro/spotify-web-api-bundle in a Laravel application?
Run composer require calliostro/spotify-web-api-bundle. In Laravel you typically bind Calliostro\SpotifyWebApiBundle\SpotifyClient in a service provider and pass credentials from config, since the package's native bundle registration applies to Symfony. If you use Symfony Flex, the bundle is enabled automatically.
Does calliostro/spotify-web-api-bundle support Laravel 10, 11, or 12?
The package is a Symfony bundle, but its SpotifyClient and token provider are plain PHP classes that Composer can autoload in Laravel. There is no official Laravel version matrix; compatibility depends on your PHP version (8.1–8.6) and how you wire the client. Test against your pinned Laravel version before adopting Symfony 8.x upper bounds in CI.
How do I configure Spotify client_id and client_secret for this package?
Register your application at the Spotify developer dashboard to obtain client_id and client_secret. In Symfony create config/packages/calliostro_spotify_web_api.yaml with those values and a redirect_uri for user-related endpoints. In Laravel store them in .env and config, then pass them to the SpotifyClientFactory or SpotifyClient. Version 1.4.0 validates credentials at runtime so blank or missing values fail at startup rather than silently later.
What is the difference between the Client Credentials and Authorization Code flows?
Client Credentials is for app-only access to catalog and search data and does not require a user login. Authorization Code is for user-related endpoints and requires the user to grant access with a redirect_uri allowlisted in the Spotify dashboard. Choose the flow based on whether your Laravel feature needs user-specific Spotify data.
Does the bundle handle Spotify token expiry and 401 retries automatically?
Yes. Version 1.4.0 adds Calliostro\SpotifyWebApiBundle\SpotifyClient, which checks token freshness and retries once after a 401 response. Its TokenProvider caches tokens in memory for 55 minutes and supports force-refresh. This is especially useful in queued jobs and long-running Artisan commands, but you should still log retries and terminal auth failures.
Is calliostro/spotify-web-api-bundle safe for Symfony Messenger workers and scheduled Artisan commands?
Version 1.4.0 reduces the main production risk by handling token freshness and 401 retries inside the client, so workers no longer need hand-rolled refresh logic. However, the token cache is per process, so parallel workers can refresh independently and may conflict if Spotify rotates refresh tokens. Verify behavior under your concurrency model and emit retry, force-refresh, and auth-failure events to logs or metrics.
How can I test a Laravel application that uses this Spotify client?
Mock or fake Calliostro\SpotifyWebApiBundle\SpotifyClient in your Laravel service container so tests do not call the live Spotify API. Use SpotifyClientFactory with test credentials when you need to exercise wiring and token-provider behavior. The package itself ships with 100% unit test coverage and PHPStan Level 8, which reduces integration uncertainty.
What deprecations were introduced in v1.4.0 and how do I migrate?
SpotifyWebApiFactory is deprecated in favor of SpotifyClientFactory. The calliostro_spotify_web_api service alias is deprecated in favor of calliostro_spotify_web_api.client. The SpotifyWebAPI\SpotifyWebAPI autowiring alias is deprecated in favor of Calliostro\SpotifyWebApiBundle\SpotifyClient. Deprecated identifiers still work in 1.4.0 but will be removed in a future major, so update service definitions, application code, and test doubles now.
Which PHP and Symfony versions does calliostro/spotify-web-api-bundle support?
The bundle supports PHP 8.1 through 8.6 and Symfony 6.4 LTS, 7.x, and 8.x, with spotify-web-api-php v6 and v7. If your Laravel application pins Symfony 8.1 or 8.2 upper bounds, confirm your dependency graph resolves cleanly before relying on those versions in CI. Symfony 6.4 LTS is the safer baseline for conservative Laravel integrations.
What are alternatives to calliostro/spotify-web-api-bundle for Laravel?
You can use jwilsson/spotify-web-api-php directly with a custom Laravel service provider and your own token-refresh cache, or evaluate other community Spotify API wrappers. This bundle adds Symfony integration, autowired API services, automatic token freshness checks, and 401 retry handling on top of that library. Compare maintenance cost and test coverage before choosing a lower-level integration.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console