From 501624949434644d56fc5116beaf3970261a4f81 Mon Sep 17 00:00:00 2001 From: Alex Shaw Date: Tue, 29 Jun 2021 08:37:20 -0400 Subject: [PATCH] feat: add setToken --- src/spotify.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/spotify.ts b/src/spotify.ts index b1a9c82..f802641 100644 --- a/src/spotify.ts +++ b/src/spotify.ts @@ -449,6 +449,16 @@ export class SpotifyPlayer { return playlists; } + /** + * Change the Spotify access token. + * + * Useful for handling refreshes. + * @param token New access token. + */ + setToken(token: string) { + this._token = token; + } + /** * Set the current volume level * @param volume Volume percentage from 0 to 100.