Files
App/api/client.ts
Violet Caulfield ca558b558f style changes
getting api client to get added to context when signed in

Server name should stay on auth screen even when a different server address is requested
2024-10-19 08:42:11 -05:00

19 lines
532 B
TypeScript

import { Api, Jellyfin } from "@jellyfin/sdk";
import { getDeviceNameSync, getUniqueIdSync } from "react-native-device-info";
import { name, version } from "../package.json"
export const client : Jellyfin = new Jellyfin({
clientInfo: {
name: name,
version: version
},
deviceInfo: {
name: getDeviceNameSync(),
id: getUniqueIdSync()
}
});
export function buildApiClient (serverUrl : string): Api {
let jellyfin = new Jellyfin(client);
return jellyfin.createApi(serverUrl);
}