Home

Awesome

SpotifyService

Status of this project

This project is currently under development, and breaking changes are expected to be introduced frequently.

The goal of this project

To create a high-level Spotify API for FOSS Blazor WebAssembly projects, providing services such as Spotify playback in the browser, managing OAuth authorization, access to the Spotify Web API, IndexedDB caching and more.

Areas currently implemented

Demo

Most of SpotifyService's functionality was originally implemented for use in Cærostris, a Blazor WebAssembly Spotify client. The latest version of Cærostris can be accessed here.

Requirements

Your application should use .NET 5.0.0 or higher.

How to use

Design considerations

Examples

Fetching all of the user's saved tracks:

@inject SpotifyService Spotify

@code
{
    private IEnumerable<SavedTrack>? tracks;

    protected override async Task OnInitializedAsync()
    {
        if (await Spotify.Auth.IsUserLoggedIn())
            tracks = await Spotify.Library.GetSavedTracks();
    }
}