import { SubsonicAPI } from "subsonic-api";
const api = new SubsonicAPI({
url: "https://demo.navidrome.org",
type: "navidrome", // or "generic" or "subsonic"
});
api.login({
username: "demo",
password: "demo",
}).then(() => {
api.getTopSongs({count: 50}).then(songs => console.log(songs));
console.log("logged in");
}).catch(err => {
console.log("subsonic error:", err);
});
Error in console:
subsonic error: TypeError: Unknown encoding: base64url
at Uint8Array.slowToString (index.js:544:32)
at Uint8Array.toString (index.js:606:23)
at M (index.js:1:9081)
at n.E_fn (index.js:1:10196)
at n.G_fn (index.js:1:10257)
at n.C_fn (index.js:1:11207)
at n.R_fn (index.js:1:10408)
at n.ping (index.js:1:11393)
at n.login (index.js:1:9663)
The environment is in Electron v24.1.3, Node v19.1.0 (trying to implement in https://github.com/Geoxor/amethyst)
Sample code:
Error in console: