Options
All
  • Public
  • Public/Protected
  • All
Menu

A plex.tv account

class

Account

param

Plex auth token

Hierarchy

  • Account

Index

Constructors

constructor

Properties

authToken

authToken: string

client

client: Client

Methods

authenticate

  • authenticate(username: string, password: string): Promise<User>
  • Log in to a Plex account

    Parameters

    • username: string
    • password: string

    Returns Promise<User>

    • User info

checkPin

  • checkPin(pinId: string): Promise<Pin>

devices

  • devices(): Promise<Device[]>
  • Fetch a list of devices attached to an account

    Returns Promise<Device[]>

Private fetch

  • fetch(path: string, options?: RequestOptions): Promise<any>
  • Make a JSON request to the Plex.tv API

    Parameters

    • path: string
    • Default value options: RequestOptions = {}

    Returns Promise<any>

Private fetchXML

  • fetchXML(path: string, options?: RequestOptions): Promise<unknown>
  • Make an XML request to the Plex.tv API

    Parameters

    • path: string
    • Default value options: RequestOptions = {}

    Returns Promise<unknown>

Private headers

  • headers(): Record<string, string>
  • Headers we need to send to Plex whenever we make a request

    Returns Record<string, string>

info

  • info(): Promise<User>
  • Fetch information about the currently logged in user

    Returns Promise<User>

removeDevice

  • removeDevice(deviceId: string): Promise<boolean>
  • Remove a device from the account

    Parameters

    • deviceId: string

    Returns Promise<boolean>

removeSyncItem

  • removeSyncItem(deviceId: string, syncItemId: string): Promise<boolean>
  • Remove an item from the sync list

    Parameters

    • deviceId: string
    • syncItemId: string

    Returns Promise<boolean>

requestPin

  • requestPin(): Promise<Pin>

resources

  • Fetch a list of servers and clients connected to this plex account. Useful for figuring out which server to connect to.

    Note: this API doesn't support JSON at the moment, so we need to parse the response as XML.

    Returns Promise<ResourceContainer>

servers

  • servers(): Promise<object>
  • Fetch a list of all the servers

    Returns Promise<object>

syncItems

  • syncItems(deviceId: string): Promise<object>
  • Fetch a list of items that are syncing to a device

    Parameters

    • deviceId: string

    Returns Promise<object>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc