2.0.1 • Published 3 years ago

spotify-api-request v2.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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.

2.0.1-1

3 years ago

2.0.1-0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

2.0.0-0

3 years ago

1.0.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago