For Typescript and Javascript extensions to work with Seanime, they need to run using an interpreter. This interpreter is an implementation of ECMAScript 6 and does not support Node.JS APIs, Web APIs, or modules.
However, Seanime’s version of the interpreter implements some helper APIs you might be used to, using Go under the hood.
These console methods allow your extension to print message to the main terminal output of Seanime so use them sparsely.
console.log(...data: any[])
console.debug(...data: any[])
console.error(...data: any[])
console.warn(...data: any[])
console.info(...data: any[])
Console output from ‣
On Seanime, fetch is implemented a little differently.
fetch(url: string, options?: Options): Promise<Response>
interface Options {
body?: string | URLSearchParams
method?: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "PATCH" | "OPTIONS"
headers?: Record<string, any>
}
interface Response {
status: number
statusText: string
ok: boolean
json(): any
text(): string
}
Bonus: A CloudFlare bypass is implemented under the hood. You can test in the ‣.