@jellyfin/sdk
Version:
A TypeScript SDK for Jellyfin.
29 lines (26 loc) • 1.05 kB
JavaScript
import { Api } from './api.js';
import { DiscoveryService } from './discovery/discovery-service.js';
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/** Class representing the Jellyfin SDK. */
class Jellyfin {
constructor(parameters) {
this.clientInfo = parameters.clientInfo;
this.deviceInfo = parameters.deviceInfo;
this.discovery = new DiscoveryService(this);
}
/**
* Creates an Api instance for a given server path.
* @param basePath A base path of a server.
* @param accessToken An (optional) access token to use for authentication.
* @param axiosInstance An (optional) Axios instance for the Api to use.
* @returns An Api instance.
*/
createApi(basePath, accessToken, axiosInstance) {
return new Api(basePath, this.clientInfo, this.deviceInfo, accessToken, axiosInstance);
}
}
export { Jellyfin };