(server)
Operations against the Plex Media Server System.
- getServerCapabilities - Server Capabilities
- getServerPreferences - Get Server Preferences
- getAvailableClients - Get Available Clients
- getDevices - Get Devices
- getServerIdentity - Get Server Identity
- getMyPlexAccount - Get MyPlex Account
- getResizedPhoto - Get a Resized Photo
- getServerList - Get Server List
Server Capabilities
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const result = await plexAPI.server.getServerCapabilities();
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.GetServerCapabilitiesResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.GetServerCapabilitiesResponseBody | 401 | application/json |
errors.SDKError | 4xx-5xx | / |
Get Server Preferences
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const result = await plexAPI.server.getServerPreferences();
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.GetServerPreferencesResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.GetServerPreferencesResponseBody | 401 | application/json |
errors.SDKError | 4xx-5xx | / |
Get Available Clients
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const result = await plexAPI.server.getAvailableClients();
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.GetAvailableClientsResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.GetAvailableClientsResponseBody | 401 | application/json |
errors.SDKError | 4xx-5xx | / |
Get Devices
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const result = await plexAPI.server.getDevices();
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.GetDevicesResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.GetDevicesResponseBody | 401 | application/json |
errors.SDKError | 4xx-5xx | / |
Get Server Identity
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const result = await plexAPI.server.getServerIdentity();
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.GetServerIdentityResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.GetServerIdentityResponseBody | 401 | application/json |
errors.SDKError | 4xx-5xx | / |
Returns MyPlex Account Information
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const result = await plexAPI.server.getMyPlexAccount();
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.GetMyPlexAccountResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.GetMyPlexAccountResponseBody | 401 | application/json |
errors.SDKError | 4xx-5xx | / |
Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
import { PlexAPI } from "@lukehagar/plexjs";
import { MinSize, Upscale } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const result = await plexAPI.server.getResizedPhoto({
width: 110,
height: 165,
opacity: 100,
blur: 20,
minSize: MinSize.One,
upscale: Upscale.Zero,
url: "/library/metadata/49564/thumb/1654258204",
});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetResizedPhotoRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.GetResizedPhotoResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.GetResizedPhotoResponseBody | 401 | application/json |
errors.SDKError | 4xx-5xx | / |
Get Server List
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const result = await plexAPI.server.getServerList();
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.GetServerListResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.GetServerListResponseBody | 401 | application/json |
errors.SDKError | 4xx-5xx | / |