yandex-music-client
v0.4.3
Published
``` npm i yandex-music-client ```
Downloads
55
Maintainers
Readme
JavaScript client for Yandex Music generated from OpenAPI Schema.
Installation
npm i yandex-music-client
Usage
Creating Client
import { getToken } from 'yandex-music-client/token';
import { YandexMusicClient } from 'yandex-music-client/YandexMusicClient'
const token = await getToken('your email', 'your password');
const client = new YandexMusicClient({
BASE: "https://api.music.yandex.net:443",
HEADERS: {
'Authorization': `OAuth ${config.token}`,
// specify 'en' to receive data in English
'Accept-Language': 'ru'
},
});
Getting new releases
// ...
client.landing.getNewReleases();
Getting track URL
import { getTrackUrl } from 'yandex-music-client/trackUrl';
// ...
getTrackUrl(client, trackId);