spotify-web-api-ts-edge
v0.9.7
Published
An isomorphic TypeScript wrapper for Spotify's Web API that can run on the edge
Downloads
31
Readme
This is a fork from https://github.com/adamgrieger/spotify-web-api-ts
Changes made
- removed the querystring package in favor of
urlSearchParams
- removed axios in favor of fetch making it possible to run on the edge
- zero dependencies
Warning
- I didn't test the fetches involing post, I wouldn't consider this package stable, use it with caution and lock the version when installing
Installation
pnpm
pnpm add spotify-web-api-ts-edge
yarn
yarn add spotify-web-api-ts-edge
npm
npm install spotify-web-api-ts-edge
Basic Example
import { SpotifyWebApi } from 'spotify-web-api-ts';
const spotify = new SpotifyWebApi({ accessToken: '<YOUR_ACCESS_TOKEN_HERE>' });
const { artists } = await spotify.albums.getAlbum('1uzfGk9vxMXfaZ2avqwxod');
console.log(artists.map(artist => artist.name));
// Array [ "Against All Logic" ]