SpotifyApiSpotify LogoJS

UserManager src/managers/User.ts#L17

A manager to perform actions which belongs to the spotify user web api.


Properties:

client

Methods:

follow followsPlaylist get getPlaylists unfollow

constructor(client) src/managers/User.ts#L17

No documentation found.

NameTypeDescription
clientClientThe spotify api client.

.client

Type:

Client

No documentation found.

.follow(ids) src/managers/User.ts#L70

Follow one or many users. This method requires an user authorized token.

await client.users.follow('id1', 'id2');

Returns:

Promise<boolean>

Parameters:

NameTypeDescription
idsstring[]The array of user ids.

.followsPlaylist(playlistID, ids) src/managers/User.ts#L57

Verify a list of users follows a paticular playlist.

const [userFollows] = await client.users.followsPlaylist('id');

Returns:

Promise<boolean[]>

Parameters:

NameTypeDescription
playlistIDstringThe id of the spotify playlist.
idsstring[]The array of spotify user ids.

.get(id, force) src/managers/User.ts#L26

Get an user's information.

const user = await client.users.get('id');

Returns:

Promise<"null" | User>

Parameters:

NameTypeDescription
idstringThe spotify user id.
forcebooleanWhen true, will directly fetch else will search for the cache first!

.getPlaylists(id, options) src/managers/User.ts#L39

Get the list of playlists of a user by the user's spotify id.

const playlists = await client.users.getPlaylists('id');

Returns:

Promise<Playlist[]>

Parameters:

NameTypeDescription
idstringThe spotify user id.
options{ limit?: number, offset?: number, }The limit, offset query parameter options.

.unfollow(ids) src/managers/User.ts#L84

Unfollow one or many users. This method requires an user authorized token.

await client.users.unfollow('id1', 'id2');

Returns:

Promise<boolean>

Parameters:

NameTypeDescription
idsstring[]The array of user ids.