Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mitchray/javascript-ampache
Javascript JSON API library for Ampache
https://github.com/mitchray/javascript-ampache
Last synced: 23 days ago
JSON representation
Javascript JSON API library for Ampache
- Host: GitHub
- URL: https://github.com/mitchray/javascript-ampache
- Owner: mitchray
- License: gpl-3.0
- Created: 2023-01-17T21:56:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T05:21:11.000Z (about 1 month ago)
- Last Synced: 2024-09-23T05:25:27.064Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/javascript-ampache
- Size: 326 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# javascript-ampache
A JS client for the Ampache API written in Typescript.
## Installation
```bash
npm install javascript-ampache
```## Usage
Import `javascript-ampache` module in your project and initialize it with the URL to your server e.g. http://music.com.au
```js
import AmpacheAPI from "javascript-ampache";const API = new AmpacheAPI({
url: "http://pathToYourAmpacheServer",
sessionKey: yourSessionAuthKey,
}); // debug: true - will log the final GET to console// either set the session key at time of instantiation or set/update with:
API.setSessionKey(yourSessionAuthKey);let allUsers = API.users();
let thisAlbum = API.album({ filter: 123 });
let results = API.advancedSearch({
type: "album",
operator: "and",
random: 1,
limit: 20,
rules: [
["title", 0, "monkey"], // Title contains 'monkey'
["myrating", 2, 4], // Rating is 4 stars
],
});
```## Build
```bash
npm run build
```### Special thanks
https://lyamkin.com/blog/how-to-build-api-client-library-in-js/ & https://github.com/ilyamkin/dev-to-js