Code Monkey home page Code Monkey logo

spotify-web-playback-ts's Introduction

spotify-web-playback-ts

spotify-web-playback-ts

TypeScript Wrapper for Spotify Playback SDK

Issues GitHub pull requests GitHub Downloads GitHub Total Downloads GitHub release

Node.js CI on Darwin Node.js CI on Ubuntu Node.js CI on Windows

Node.js Package CodeQL

Report Bug Request Feature

Systems on which it has been tested:

Macos

Getting started

Installation

npm i --save spotify-web-playback-ts

Usage

async function load() {
  const accessToken = '...'
  // Init playback SDK by adding async script to document and await load
  const player = await SpotifyPlayer.init(document, 'Browser Player!', 0.5, cb => cb(accessToken))
  
  // Connect the player
  await player.connect()

  // Listen to player state
  player.onPlayerStateChanged(state => console.log('State changed', state)

  // Toggle playback
  await player.togglePlay()
}

load()

Documentation

  1. Read the Spotify Playback SDK Quickstart

  2. Read the Spotify Playback SDK API reference

  3. See SpotifyPlayer type insterface for usage

spotify-web-playback-ts's People

Contributors

tkhduracell avatar na2na-p avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.