Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
simple-spotify-wrapper
Advanced tools
A small and awesome wrapper to get general information from the Spotify Web API.
A small and awesome wrapper to get general information from the Spotify Web API.
You can install the library using npm
:
$ npm i simple-spotify-wrapper
or using yarn
:
$ yarn add simple-spotify-wrapper
// import the library
import SpotifyWrapper from 'simple-spotify-wrapper';
// create a instance
const spotify = new SpotifyWrapper({
token: 'PUT YOUR TOKEN HERE'
});
const albums = spotify.search.albums('Choose your artist');
albums.then(data => console.log(data.albums));
var spotifyWrapper = require('spotify-wrapper');
<!-- to import non-minified version -->
<script src="spotify-wrapper.umd.js"></script>
<!-- to import minified version -->
<script src="spotify-wrapper.umd.min.js"></script>
After that the library will be available to the Global as SpotifyWrapper
. Check this example:
const spotify = new SpotifyWrapper({
token: 'PUT YOUR TOKEN HERE'
});
const albums = spotify.search.albums('Choose your artist');
albums.then(data => console.log(data.albums.items));
Below are all the methods that the library provide:
Search for informations about Artists with provided query. Test in Spotify Web Console with type defined as artist.
Arguments
Argument | Type | Options |
---|---|---|
query | string | 'Any search query' |
Example
search.artists('Isadora Pompeo')
.then(data => {
// do what you want here
})
Search for informations about Albums with provided query. Test in Spotify Web Console with type defined as album.
Arguments
Argument | Type | Options |
---|---|---|
query | string | 'Any search query' |
Example
spotify.search.albums('Isadora Pompeo')
.then(data => {
// do what you want here
})
Search for informations about Tracks with provided query. Test in Spotify Web Console with type defined as track.
Arguments
Argument | Type | Options |
---|---|---|
query | string | 'Any search query' |
Example
spotify.search.tracks('Isadora Pompeo')
.then(data => {
// do what you want here
})
Search for informations about Playlists with provided query. Test in Spotify Web Console with type defined as playlist.
Arguments
Argument | Type | Options |
---|---|---|
query | string | 'Any search query' |
Example
spotify.search.tracks('Isadora Pompeo')
.then(data => {
// do what you want here
})
Search for informations about a specific Album with a id.
Arguments
Argument | Type | Options |
---|---|---|
id | string | 'Specific id' |
Example
spotify.album.getAlbum('4aawyAB9vmqN3uQ7FjRGTy')
.then(data => {
// do what you want here
})
Search for informations about a specific Album with their ids.
Arguments
Argument | Type | Options |
---|---|---|
ids | Array of strings | ['id1', 'id2'] |
Example
spotify.album.getAlbums(['4aawyAB9vmqN3uQ7FjRGTy', '1A2GTWGtFfWp7KSQTwWOyo'])
.then(data => {
// do what you want here
})
Search for all tracks from a specific album.
Arguments
Argument | Type | Options |
---|---|---|
id | string | 'Specific id' |
Example
spotify.album.getTracks('4aawyAB9vmqN3uQ7FjRGTy')
.then(data => {
// do what you want here
})
This library relies on Fetch API. And this API is supported in the following browsers.
42+ ✔ | 39+ ✔ | 29+ ✔ | 10.1+ ✔ | Nope ✘ |
This library depends on fetch to make requests to the Spotify Web API. For environments that don't support fetch, you'll need to provide a polyfill to browser or polyfill to node.
To run the tests you can use the following command inside the project folder:
npm test
Or if you want to test the coverage use:
npm run test:coverage
If you want to submit your application read the CONTRIBUTING.md for more details.
If you want to help in the project or see the upcoming methods check this link.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details.
João Pedro Schmitz |
FAQs
A small and awesome wrapper to get general information from the Spotify Web API.
We found that simple-spotify-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.