spotify-playback-sdk
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "spotify-playback-sdk", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "dist/spotify.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/spotify.d.js", |
@@ -1,10 +0,12 @@ | ||
# spotify-playback-sdk-node | ||
# spotify-playback-sdk | ||
This is an inofficial NodeJS Wrapper for the Spotify Web Playback SDK | ||
An inofficial NodeJS Wrapper for the Spotify Web Playback SDK | ||
This package is an improved version of [flam3rboy's package](https://github.com/Flam3rboy/spotify-playback-sdk-node.git) | ||
## Installation | ||
``` | ||
npm i spotify-playback-sdk-node | ||
# or "yarn add spotify-playback-sdk-node" | ||
npm i spotify-playback-sdk | ||
# or "yarn add spotify-playback-sdk" | ||
``` | ||
@@ -17,3 +19,3 @@ | ||
```js | ||
require("spotify-playback-sdk-node"); | ||
require("spotify-playback-sdk"); | ||
``` | ||
@@ -24,3 +26,3 @@ | ||
```js | ||
import "spotify-playback-sdk-node"; | ||
import "spotify-playback-sdk"; | ||
``` | ||
@@ -35,3 +37,3 @@ | ||
const spotify = new SpotifyPlaybackSDK(); | ||
await spotify.init(); | ||
await spotify.init({ /* puppeteerLaunchArgs */ }); | ||
@@ -64,3 +66,3 @@ const player = await spotify.createPlayer({ | ||
constructor(); | ||
init(opts?: { executablePath?: string }): Promise<this>; | ||
init(opts?: LaunchOptions): Promise<this>; | ||
createPlayer(opts: PlayerOptions) : Promise<SpotifyPlayer>; | ||
@@ -106,57 +108,1 @@ destroy() : Promise<void>; | ||
``` | ||
## Structures | ||
```ts | ||
type WebPlaybackPlayer = { | ||
device_id: string; | ||
}; | ||
type WebPlaybackTrack = { | ||
uri: string; | ||
id: string; | ||
type: "track" | "episode" | "ad"; | ||
media_type: "audio" | "video"; | ||
name: string; | ||
is_playable: boolean; | ||
album: { | ||
uri: string; | ||
name: string; | ||
images: { | ||
url: string; | ||
}[]; | ||
}; | ||
artists: { | ||
uri: string; | ||
name: string; | ||
}[]; | ||
}; | ||
type WebPlaybackState = { | ||
context: { | ||
uri: string; | ||
metadata: any; | ||
}; | ||
disallows: { | ||
pausing: boolean; | ||
peeking_next: boolean; | ||
peeking_prev: boolean; | ||
resuming: boolean; | ||
seeking: boolean; | ||
skipping_next: boolean; | ||
skipping_prev: boolean; | ||
}; | ||
paused: boolean; | ||
position: number; | ||
repeat_mode: number; | ||
shuffle: boolean; | ||
track_window: { | ||
current_track: WebPlaybackTrack; | ||
previous_tracks: WebPlaybackTrack[]; | ||
next_tracks: WebPlaybackTrack[]; | ||
}; | ||
}; | ||
type WebPlaybackError = { | ||
message: string; | ||
}; | ||
``` |
35350
104