4.0.3 ā€¢ Published 5 days ago

@jeromefitz/spotify v4.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

@jeromefitz/spotify

Custom API for jeromefitzgerald.com/music.

  • nowPlaying: Current Track
  • topArtists: Top Artists
  • topTracks: Top Tracks

šŸ› ļø Usage

Must provide:

const {
  SPOTIFY_CLIENT_ID: clientId,
  SPOTIFY_CLIENT_SECRET: clientSecret,
  SPOTIFY_REFRESH_TOKEN: refreshToken,
} = process.env

const credentials = {
  clientId,
  clientSecret,
  refreshToken,
}

const spotify: ClientProps = new Client({ ...credentials })

This will get the Authorization Token for the Bearer and consistently apply for API calls on your behalf.

šŸ“ļø Note: Need to verify w. 2.0.1 release what happens if the token expires šŸ˜…ļø (before we were getting the token on every request)

Following functions are exposed via spotify.get.*:

  • nowPlaying: Current Track
  • topArtists: Top Artists
  • topTracks: Top Tracks

Example:

spotify.get.topArtists({
  limit,
  offset,
  time_range,
  withImages: true,
})

āœØļø Customizations

šŸ§‘ā€šŸŽ¤ļø artist

For a track we create an artist key that maps across all available artists[artist.name].

šŸ–¼ļø withImages

If this is passed we dynamically use plaiceholder to add an image key to:

  • nowPlaying: album
  • topArtists: artist
  • topTracks: album

Only call this via an API call.

4.0.3

5 days ago

4.0.2

3 months ago

4.0.1

3 months ago

4.0.0-canary.2

3 months ago

4.0.0

3 months ago

4.0.0-canary.1

3 months ago

3.0.4

10 months ago

3.0.4-canary.1

10 months ago

3.0.4-canary.2

10 months ago

3.0.3

1 year ago

2.3.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.3.2

2 years ago

2.3.0-canary.1

2 years ago

2.3.0

2 years ago

2.3.1

2 years ago

2.3.0-canary.2

2 years ago

2.2.0-canary.1

2 years ago

2.2.0

2 years ago

1.1.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.4

2 years ago

2.1.6

2 years ago

2.1.5

2 years ago

1.1.0-notion.1

2 years ago

2.0.0-npm-dist.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago