src/Spotify.js
/**
   * Attempts to log the client in and obtain a token
   * @async
   * @returns Promise
   */
Attempts to log the client in and obtain a token
@async
@returns Promise
Attempts to log the client in and obtain a token @async @returns Promise
async login() {
    return new Promise((resolve, reject) => {
      fetch("https://accounts.spotify.com/api/token", {
        method: "post",
        headers: {
          Authorization: `Basic ${new Buffer.from(
            `${this._clientID}:${this._clientSecret}`
          ).toString("base64")}`,
        },
        body: new URLSearchParams({ grant_type: "client_credentials" }),
      })
        .then((res) => res.json())
        .then((res) => {
          this._token = res.access_token;
          this.authenticated = true;
          this.albums = new Albums(this);
          this.artists = new Artists(this);
          this.browse = new Browse(this);
          this.playlists = new Playlists(this);
          this.tracks = new Tracks(this);
          this.users = new Users(this);
          resolve();
        })
        .catch((error) => {
          reject(error);
        });
    });
  }
async login ( ) { return new Promise ( ( resolve , reject ) => { fetch ( "https://accounts.spotify.com/api/token" , { method : "post" , headers : { Authorization : ` ${ new Buffer . from ( ` ${ this . _clientID } ${ this . _clientSecret } ` ) . toString ( "base64" ) } ` , } , body : new URLSearchParams ( { grant_type : "client_credentials" } ) , } ) . then ( ( res ) => res . json ( ) ) . then ( ( res ) => { this . _token = res . access_token ; this . authenticated = true ; this . albums = new Albums ( this ) ; this . artists = new Artists ( this ) ; this . browse = new Browse ( this ) ; this . playlists = new Playlists ( this ) ; this . tracks = new Tracks ( this ) ; this . users = new Users ( this ) ; resolve ( ) ; } ) . catch ( ( error ) => { reject ( error ) ; } ) ; } ) ; }
Attempts to log the client in and obtain a token
 @async
 @returns Promise
Attempts to log the client in and obtain a token @async @returns Promise