v0.2.1
Deno library and CLI to access the ListenBrainz API
Attributes
Includes Deno configuration
Repository
Current version released
8 months ago
Dependencies
std
listenbrainz
Deno library to access the ListenBrainz API, written in TypeScript.
You can use it to submit your listening history to your ListenBrainz account.
As this library only makes use of web standards, it is also compatible with modern browsers (after transpilation to JavaScript).
Features
- Submits listens and playing now notifications
- Handles ListenBrainz authorization with user token
- Adheres to rate limits and optionally retries failed requests
- Provides generic
GET
andPOST
methods for (yet) unsupported API endpoints - Ships with type definitions and inline documentation
Usage
In order to submit listens, you have to specify a user token which you can obtain from your ListenBrainz profile.
The following example instantiates a ListenBrainz client with a token from an environment variable and submits a playing now notification for a track:
import { ListenBrainzClient } from "https://deno.land/x/listenbrainz@v0.2.0/client.ts";
const client = new ListenBrainzClient({ userToken: Deno.env.get("LB_TOKEN") });
await client.playingNow({ artist_name: "John Doe", track_name: "Love Song" });