PlexAccount

class PlexAccount(client, data)

Represents a user’s plex.tv account information. Used for listing associated devices, see getResource, getResources or getServer.

This is an internal class and should not be instantiated directly. Instead use PlexAccount.login to create an instance.

Arguments:
  • client (PlexClient) – the connection info to use for API calls.
  • data (*) – the parsed data for the account.
PlexAccount.login(client, username, password)

Logs in to a plex.tv account and returns a PlexAccount instance.

Arguments:
  • client (PlexClient) – the client data to use to request login.
  • username (String) – the user’s username.
  • password (String) – the user’s password.
Returns:

Promise.<PlexAccount> – the account instance on success.

PlexAccount.getResource(name)

Retrieves a PlexDevice for a recently used resource. This generally means API clients that can be controlled or accessed in some way.

Arguments:
  • name (String) – the name of the device
Returns:

Promise.<PlexDevice> – the device on success.

PlexAccount.getResources(provides)

Retrieves a list of PlexDevice’s that support the passed features.

Arguments:
  • provides (Array.<String>) – a list of features the resource should support.
Returns:

Promise.<Array.<PlexDevice>> – a list of devices.

PlexAccount.getServers()

A shortcut for getting the server resources.

Returns:Promise.<Array.<PlexDevice>> – a list of servers.