Socket
Socket
Sign inDemoInstall

@ekwoka/spotify-api

Package Overview
Dependencies
0
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.0 to 0.10.0

dist/endpoints/player/addToQueue.d.ts

1

dist/endpoints/index.d.ts

@@ -13,2 +13,3 @@ export { albumIsSaved } from './albums/albumIsSaved';

export { getArtists } from './artists/getArtists';
export { addToQueue } from './player/addToQueue';
export { recentlyPlayedTracks } from './player/recentlyPlayedTracks';

@@ -15,0 +16,0 @@ export { getPlaylist } from './playlists/getPlaylist';

@@ -13,2 +13,3 @@ export { albumIsSaved } from './albums/albumIsSaved';

export { getArtists } from './artists/getArtists';
export { addToQueue } from './player/addToQueue';
export { recentlyPlayedTracks } from './player/recentlyPlayedTracks';

@@ -15,0 +16,0 @@ export { getPlaylist } from './playlists/getPlaylist';

@@ -0,1 +1,2 @@

export { addToQueue } from './addToQueue';
export { recentlyPlayedTracks } from './recentlyPlayedTracks';

@@ -2,0 +3,0 @@ export type { RecentlyPlayedTrackList } from './recentlyPlayedTracks';

@@ -0,1 +1,2 @@

export { addToQueue } from './addToQueue';
export { recentlyPlayedTracks } from './recentlyPlayedTracks';

2

dist/index.d.ts
export { fetchOptions, makeAuthURL, refreshToken, tokensFromCode, } from './auth';
export { resetCache, setToken, spotifyApiClient } from './core';
export { albumIsSaved, getAlbum, getAlbums, getAlbumTracks, getArtist, getArtists, getCurrentUser, getPlaylist, getRecommendations, getSavedAlbums, getTopItems, getUserProfile, getUsersPlaylists, newReleases, recentlyPlayedTracks, removeAlbums, removeTracks, saveAlbums, saveTracks, search, trackIsSaved, } from './endpoints';
export { albumIsSaved, addToQueue, getAlbum, getAlbums, getAlbumTracks, getArtist, getArtists, getCurrentUser, getPlaylist, getRecommendations, getSavedAlbums, getTopItems, getUserProfile, getUsersPlaylists, newReleases, recentlyPlayedTracks, removeAlbums, removeTracks, saveAlbums, saveTracks, search, trackIsSaved, } from './endpoints';
export { spotifyFetch } from './utils/spotifyFetch';

@@ -5,0 +5,0 @@ export type { RefreshedToken, SpotifyTokens } from './auth';

export { fetchOptions, makeAuthURL, refreshToken, tokensFromCode, } from './auth';
export { resetCache, setToken, spotifyApiClient } from './core';
export { albumIsSaved, getAlbum, getAlbums, getAlbumTracks, getArtist, getArtists, getCurrentUser, getPlaylist, getRecommendations, getSavedAlbums, getTopItems, getUserProfile, getUsersPlaylists, newReleases, recentlyPlayedTracks, removeAlbums, removeTracks, saveAlbums, saveTracks, search, trackIsSaved, } from './endpoints';
export { albumIsSaved, addToQueue, getAlbum, getAlbums, getAlbumTracks, getArtist, getArtists, getCurrentUser, getPlaylist, getRecommendations, getSavedAlbums, getTopItems, getUserProfile, getUsersPlaylists, newReleases, recentlyPlayedTracks, removeAlbums, removeTracks, saveAlbums, saveTracks, search, trackIsSaved, } from './endpoints';
export { spotifyFetch } from './utils/spotifyFetch';

@@ -10,3 +10,3 @@ /**

*/
export declare const spotifyFetch: <T>(endpoint: string, token: string, data?: Record<string, unknown>) => Promise<T>;
export declare const spotifyFetch: <T>(endpoint: string, token: string, data?: Record<string, unknown>, hasReturn?: boolean) => Promise<T>;
//# sourceMappingURL=spotifyFetch.d.ts.map

@@ -11,3 +11,3 @@ import { SPOTIFY_URL } from '../constants';

*/
export const spotifyFetch = async (endpoint, token, data = {}) => {
export const spotifyFetch = async (endpoint, token, data = {}, hasReturn = true) => {
try {

@@ -23,2 +23,4 @@ const headers = {

throw new Error(response.status.toString());
if (!hasReturn)
return null;
return await response.json();

@@ -25,0 +27,0 @@ }

@@ -16,3 +16,3 @@ {

"license": "MIT",
"version": "0.9.0",
"version": "0.10.0",
"description": "Composable Wrapper for the Spotify Web Api and Spotify Web Playback SDK",

@@ -19,0 +19,0 @@ "repository": "github:ekwoka/spotify-api",

@@ -271,5 +271,15 @@ # ⚡️A tree-shakable, composable, lightweight wrapper for the multiple Spotify APIs🔥

- `addToQueue` - Posts new item to the current playback queue
- `recentlyPlayedTracks` - Gets user's recently played tracks
#### addToQueue
Posts the provided item URI (track or episode) to the active playback queue.
```js
client(addToQueue('spotify:track:5expoVGQPvXuwBBFuNGqBd'))
```
If there is any error, this function will throw (as with all endpoints) but will return `null` when successful.
#### recentlyPlayedTracks

@@ -280,4 +290,4 @@

```js
const recentlyPlayed = client(recentlyPlayed())
const recentlypPlayedFiltered = client(recentlyPlayed({
const recentlyPlayed = await client(recentlyPlayed())
const recentlypPlayedFiltered = await client(recentlyPlayed({
after: 1145736000000,

@@ -284,0 +294,0 @@ before: 1653508800000,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc