TypeScript SDK for Jellyfin
Go to file
dependabot[bot] c4379e10ed
Bump @openapitools/openapi-generator-cli from 2.4.10 to 2.4.12
Bumps [@openapitools/openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator-cli) from 2.4.10 to 2.4.12.
- [Release notes](https://github.com/OpenAPITools/openapi-generator-cli/releases)
- [Changelog](https://github.com/OpenAPITools/openapi-generator-cli/blob/master/.releaserc)
- [Commits](https://github.com/OpenAPITools/openapi-generator-cli/compare/v2.4.10...v2.4.12)

---
updated-dependencies:
- dependency-name: "@openapitools/openapi-generator-cli"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 19:10:40 +00:00
.github Bump actions/setup-node from 2.4.0 to 2.4.1 2021-09-27 19:10:58 +00:00
.vscode Add config to let ESLint format and fix on save 2021-09-23 11:12:15 +02:00
docs Update documentation 2021-10-08 13:39:08 -04:00
scripts Fix openapi schema 2021-08-30 00:36:18 -04:00
src Fix issues with axios update 2021-10-07 09:39:43 -04:00
.eslintignore Initial commit 2021-08-29 01:00:52 -04:00
.eslintrc.js Added rule to enforce braces for conditional statements 2021-10-06 13:14:17 +02: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 Use groups for integration and unit tests 2021-09-21 00:38:48 -04:00
codecov.yml Add codecov configuration 2021-09-20 15:58:00 -04:00
jest.config.js Ignore __helpers__ for test coverage 2021-09-21 10:18:25 -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 Bump @openapitools/openapi-generator-cli from 2.4.10 to 2.4.12 2021-10-11 19:10:40 +00:00
package.json 0.2.0 2021-10-08 13:36:59 -04:00
README.md Update README 2021-10-08 13:27:22 -04:00
tsconfig.json Update tsc target to ES5 2021-10-08 13:34:40 -04:00

jellyfin-sdk-typescript

MPL-2.0 license Current Release npm Codecov

A TypeScript SDK for Jellyfin.

Warning: This project is under active development API changes may 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'
    }
});

// Find a valid server by trying to connect using common protocols and ports.
// Each server receives a score based on security, speed, and other criteria.
const servers = await jellyfin.discovery.getRecommendedServerCandidates('demo.jellyfin.org/stable');
// A utility function for finding the best result is available.
// If there is no "best" server, an error message should be displayed.
const best = jellyfin.discovery.findBestServer(servers);

// Create an API instance
const api = jellyfin.createApi(best.address);

// 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('demo', '');
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);

// A helper method for logging out the current user has been added to the
// SDK so the internal state is updated correctly.
await api.logout();