1.13.0 • Published 11 months ago

@statsfm/spotify.js v1.13.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
11 months ago

spotify.js

CI

An API wrapper for Spotify, written in Typescript. Made for stats.fm.

Documentation.

Features

  • Support for both the authorization code flow and the client credentials flow.
  • Automatic token refreshing.
  • Retries requests when the ratelimit is hit.
  • Highly configurable.

Usage

# using yarn
yarn add @statsfm/spotify.js
# or with npm
npm install @statsfm/spotify.js
import { SpotifyAPI } from '@statsfm/spotify.js';

const api = new SpotifyAPI({
  clientCredentials: {
    clientId: '',
    clientSecret: '',
  },
  accessToken: '', // optional, required for private user data
  refreshToken: '', // optional, required for private user data and automatic token refreshing
});

const tracks = await api.tracks
  .list([
    '2cc8Sw1OnCuA5bV8nqWqpE',
    '4a8pP5X2lxwU5aprY44jLn',
    '5lIFsEWj9IjNEALbHnPosE',
    '4S4RWAA749dKyJQ5CiKEBJ',
    '4ZtFanR9U6ndgddUvNcjcG',
  ])
  .then((tracks) => {
    tracks.forEach((track) => {
      console.log(`${track.name} - ${track.artists[0].name}`);
    });
  })
  .catch(console.error);
1.12.3

12 months ago

1.13.0

11 months ago

1.12.4-rc.5

11 months ago

1.12.4-rc.4

11 months ago

1.12.4-rc.7

11 months ago

1.12.4-rc.6

11 months ago

1.12.4-rc.8

11 months ago

1.12.4-rc.1

11 months ago

1.12.4-rc.0

11 months ago

1.12.4-rc.3

11 months ago

1.12.4-rc.2

11 months ago

1.12.2

1 year ago

1.12.1

1 year ago

1.12.0

1 year ago

1.11.8

1 year ago

1.11.4

2 years ago

1.11.2

2 years ago

1.11.1

2 years ago

1.11.7

2 years ago

1.11.6

2 years ago

1.11.5

2 years ago

1.11.0

2 years ago

1.10.0

3 years ago

1.9.2

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.5

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.4

3 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago