🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

spotify-api-request

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

spotify-api-request

A typescript supported wrapper for the Spotify Web API.

2.0.1
unpublished
latest
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Spotify API Request

A typescript supported wrapper for the Spotify web API

Build Status NPM version NPM download count

Installation

Install using Yarn or NPM

yarn add spotify-api-request

Authorization

Tokens are used to make requests. This method will get you a valid token for the next hour. There are four methods authorization (described in documentation).

import { getToken } from 'spotify-api-request'

const token = await getToken({
  clientId: clientId,
  clientSecret: clientSecret
})

Making requests

Now, we can use that token to make requests.

import { searchForItem } from 'spotify-api-request'

async function searchForShow(showName: string) {
  const token = await getToken()

	const searchRes = await searchForItem(token, {
    q: showName,
    type: 'shows'
  })
  
  return searchRes.shows.items
}

Every response is wrapped in a promise, so async/await is really helpful here.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure you update all test and documentation as appropriate.

Keywords

spotify

FAQs

Package last updated on 02 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts