TypeScript SDK for Jellyfin
Go to file
2021-09-20 16:20:10 -04:00
.github Bump codecov/codecov-action from 2.0.3 to 2.1.0 2021-09-19 07:04:56 +00:00
.vscode Add vscode config 2021-09-20 16:17:35 -04:00
docs Update documentation 2021-09-18 23:37:08 -04:00
scripts Fix openapi schema 2021-08-30 00:36:18 -04:00
src Add more tests and disable integration tests 2021-09-20 11:02:26 -04:00
.eslintignore Initial commit 2021-08-29 01:00:52 -04:00
.eslintrc.js Update eslint rules 2021-09-17 11:00:46 -04:00
.gitattributes Initial commit 2021-08-29 01:00:52 -04:00
.gitignore Add test coverage 2021-09-16 16:27:30 -04:00
.npmignore Update npmignore 2021-09-20 16:20:10 -04:00
codecov.yml Add codecov configuration 2021-09-20 15:58:00 -04:00
jest.config.js Add test coverage 2021-09-16 16:27:30 -04:00
LICENSE Update license 2021-09-14 01:10:15 -04:00
openapi.json Update openapi spec to 10.7.7 2021-09-16 00:33:29 -04:00
openapitools.json Initial commit 2021-08-29 01:00:52 -04:00
package-lock.json Add more tests and disable integration tests 2021-09-20 11:02:26 -04:00
package.json Bump dependencies 2021-09-19 03:18:35 -04:00
README.md Add install instructions 2021-09-20 14:29:00 -04:00
tsconfig.json Remove models entry point for docs 2021-09-16 11:36:56 -04:00

jellyfin-sdk-typescript

MPL-2.0 license Current Release Codecov

A TypeScript SDK for Jellyfin.

Warning: This project is under active development and is not ready for production use. API changes will occur.

Install

npm i --save @thornbill/jellyfin-sdk

or

yarn add @thornbill/jellyfin-sdk

Usage

// Create a new instance of the SDK
const jellyfin = new Jellyfin({
    clientInfo: {
        name: 'My Client Application',
        version: '1.0.0'
    },
    deviceInfo: {
        name: 'Device Name',
        id: 'unique-device-id'
    }
});
const api = jellyfin.createApi('https://demo.jellyfin.org/stable');

// Each API endpoint is exposed via a getter on the SDK instance using
// a shared Configuration and Axios instance. For example the /System APIs
// are available as api.systemApi.

// Fetch the public system info
const info = await api.systemApi.getPublicSystemInfo();
console.log('Info =>', info.data);

// Fetch the list of public users
const users = await api.userApi.getPublicUsers();
console.log('Users =>', users.data);

// A helper method for authentication has been added to the SDK because
// the default method exposed in the generated Axios client is rather
// cumbersome to use.
const auth = await api.authenticateUserByName({ Username: 'demo', Pw: '' });
console.log('Auth =>', auth.data);

// Authentication state is stored internally in the Api class, so now
// requests that require authentication can be made normally
const libraries = await api.libraryApi.getMediaFolders();
console.log('Libraries =>', libraries.data);