
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@ekwoka/spotify-api
Advanced tools
Composable Wrapper for the Spotify Web Api and Spotify Web Playback SDK
Born from my own difficulties using other wrapper libraries for Spotify, this library seeks to be the best possible API wrapper.
NOTE: This library is still very much a work in progress and will be subject to breaking changes and regular updates until this note is removed.
Simply install with your favourite flavour of Package Manager
npm add @ekwoka/spotify-api
pnpm add @ekwoka/spotify-api
bun install @ekwoka/spotify-api
yarn add @ekwoka/spotify-api
To get started, you'll need to import the core client from the package, and initialize it.
import { SpotifyApi } from '@ekwoka/spotify-api'
export const client = SpotifyApi() // optionally pass in the users access token string
This will create the core client structure with which you'll manage and run requests to the Spotify Apis.
If a token is not set (and is required for a request) the client will throw an error.
To set a token after initialization (or update during ongoing usage) simply import and use the setToken
composable with your client.
import { SpotifyApi, setToken } from '@ekwoka/spotify-api'
const client = SpotifyApi() // no token
client(setToken('my_new_token')) // adds new token
As you'll notice, this is not a method on the client object like many other libraries. This is a composable function. The goal is for all interactions with the client and APIs to be composable functions. This will enable very aggressive tree-shaking to keep minimal clients from shipping lots of unused code, as well as enable code-splitting for larger applications.
Endpoints are importable both from @ekwoka/spotify-api
or @ekwoka/spotify-api/endpoints
for convenience.
NOTE: The following documentation uses the same structure as the Official Spotify Docs for organization
Currently Available methods in the Users category include:
getCurrentUser
- Retrieves data related to the actively logged in user (as defined by access token)const user = client(getCurrentUser())
console.log(user) // should log user
FAQs
Composable Wrapper for the Spotify Web Api and Spotify Web Playback SDK
The npm package @ekwoka/spotify-api receives a total of 10 weekly downloads. As such, @ekwoka/spotify-api popularity was classified as not popular.
We found that @ekwoka/spotify-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.