spotify-wrapper-leonardo
v1.0.4
Published
Um wrapper para trabalhar com a Spotify Web API
Downloads
2
Readme
Spotify Wrapper
Um wrapper para trabalhar com a Spotify Web API
Dependências
Essa biblioteca depende de fetch para fazer requisições a Spotify Web API. Para ambientes que não oferecem suporte à busca, é necessário fornecer um polyfill para navegador ou polyfill para Node.
Instalação
npm install spotify-wrapper-leonardo --save
Como usar
ES6
// importar um método específico
import SpotifyWrapper from 'spotify-wrapper-leonardo';
const spotify = new SpotifyWrapper({
token: 'SEU_TOKEN_AQUI'
});
// usando o método
spotify.search.artists('Incubus');
CommonJS
const SpotifyWrapper = require('spotify-wrapper-leonardo').default;
const spotify = new SpotifyWrapper({
token: 'SEU_TOKEN_AQUI'
});
UMD no Browser
<script src="spotify-wrapper.umd.js"></script>
Depois disso, a biblioteca estará disponível para o Global como SpotifyWrapper
. Siga um exemplo:
const spotify = new SpotifyWrapper({
token: 'SEU_TOKEN_AQUI'
});
const albums = spotify.search.albums('Artista escolhido');