{"id":28569892,"url":"https://github.com/amberbyte/librespot-node","last_synced_at":"2025-06-10T17:39:33.278Z","repository":{"id":96599858,"uuid":"460137084","full_name":"AmberByte/librespot-node","owner":"AmberByte","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-20T19:27:09.000Z","size":87,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-16T21:55:05.104Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AmberByte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-16T18:53:57.000Z","updated_at":"2023-04-06T11:21:27.000Z","dependencies_parsed_at":"2023-03-13T16:28:46.867Z","dependency_job_id":null,"html_url":"https://github.com/AmberByte/librespot-node","commit_stats":null,"previous_names":["amberbyte/librespot-node"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmberByte%2Flibrespot-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmberByte%2Flibrespot-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmberByte%2Flibrespot-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmberByte%2Flibrespot-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmberByte","download_url":"https://codeload.github.com/AmberByte/librespot-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmberByte%2Flibrespot-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259118826,"owners_count":22808063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-10T17:39:30.727Z","updated_at":"2025-06-10T17:39:33.237Z","avatar_url":"https://github.com/AmberByte.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# librespot-node\n\nAn easy to use Node.js wrapper for [librespot](https://github.com/librespot-org/librespot), an open source Spotify client, based on [neon](https://github.com/neon-bindings/neon)\n\n## Building\n1. Clone this repo\n2. run `npm install` inside the root folder\n3. Once everything is installed, run `npx neon build` to start building the native module\n4. Build Typescript code with `npm run build` / `npm run watch`\n\n## Basic Examples\n\n### Playing a song\n```js\nconst { Spotify } = require('../native');\nconst spotify = new Spotify('\u003cusername\u003e', '\u003cpassword\u003e');\n\n// Load specified track (by id) and starts playing\nspotify.play('\u003ctrack-id\u003e');\n\nsetInterval(() =\u003e {\n    console.log('playing? ', spotify.isPlaying());\n}, 1000);\n```\n\n### Getting web token (can be used for retrieving metadata)\n```js\nconst { Spotify } = require('../native');\nconst spotify = new Spotify('\u003cusername\u003e', '\u003cpassword\u003e');\n\nspotify.getToken('\u003cspotify-client-id\u003e', '\u003cscopes\u003e', (token) =\u003e {\n    console.log(token.getToken(), token.getExpiry(), token.getScope());\n});\n```\n\n## API (Work in progress)\n\n```ts\ninterface Spotify {\n    constructor({\n        username: string,\n        password: string,\n        quality?: enum\n        cacheDir?: string, \n        connect {\n            type: enum,\n            name: string\n        }\n    })\n    play(trackId: string);\n    stop();\n    pause();\n    seek(positionMs: number) throws;\n    getPosition(): throws number\n    getTrack(): throws string\n    isPlaying(): boolean;\n    emit: started, stopped, loading, playing, paused, endoftrack, volumeset\n}\n\nget current volume\n\ninterface AccessToken {\n    getToken(): string;\n    getExpiry(): number;\n    getScope(): string[];\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famberbyte%2Flibrespot-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famberbyte%2Flibrespot-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famberbyte%2Flibrespot-node/lists"}