Skip to main content
The Vyla SDK (@vyla-entertainment/sdk) is a server-side JavaScript/TypeScript framework that provides direct access to Vyla’s stream scrapers, health probes, download resolvers, and subtitle providers. By embedding the SDK directly into your backend application, you execute scrapers locally within your own environment. This is an alternative to self-hosting the full Vyla API server — the SDK gives you the same streaming capabilities but embedded directly in your Node.js application, eliminating REST API rate limits, reducing network latency, and giving you total control over execution timeouts, IP forwarding, and headers.
The SDK repository is public and can be used independently of the self-hosted API server. If you prefer to embed streaming functionality directly into your existing Node.js application rather than running a separate API server, the SDK is the recommended approach.

Features

  • Direct-to-Client Playback: Scraped streams link directly to source CDNs. No proxy server overhead required unless specified by provider headers.
  • Built-In Health Probing: Monitor latency and uptime per provider with built-in health check utilities.
  • Automated Anime Sub/Dub Routing: Automatically configures audio track requirements (sub vs dub) based on provider naming conventions.
  • Multi-Source Subtitle Aggregation: Merges subtitle tracks from multiple redundant subtitle mirrors into a unified VTT/SRT format.
  • Metadata Fallbacks: Automatically maps TMDB IDs to external IDs (such as IMDB and AniList) for smooth stream lookups.
  • Self-Contained: No need to deploy a separate API server — all streaming functionality runs within your existing Node.js application.

Installation

Install the package into your Node.js backend using your package manager of choice:
Note: Node.js v18+ is required due to modern standard fetch and AbortSignal.timeout usage.

Initialization

Initialize the VylaSDK client by supplying your TMDB API Key. The key resolves media metadata, validates movie/TV show IDs, and translates TMDB IDs into AniList IDs for anime sources. You may optionally provide a pengu.uk manifest URL to enable the Pengu source.

Core Methods

getStream(key, id, s?, e?, clientIP?)

Scrapes video stream URLs and playability headers for a specified provider key.

Parameters

Example Response Format


getSubtitles(id, s?, e?)

Fetches subtitle files aggregated across multiple subtitle backend mirrors (v1, v2, febbox). Returns clean VTT and SRT tracks.

Parameters

Example Response Format


getDownloads(id, s?, e?)

Fetches direct downloadable media files (MP4/MKV) paired with resolution and file size descriptors.

Example Response Format


Provider & Health Management

getSources(excludeDisabled?)

Retrieves provider configurations registered in the SDK.

Parameters


probeSource(key)

Executes a health ping test against a single provider to determine current availability and latency using a probe payload (TMDB ID: 155).

probeAllSources()

Executes health tests in parallel across all non-disabled provider modules.

Example Response Format


Provider Metadata Properties

When calling getSources(), each provider entry returns metadata describing its features and streaming behavior:

Property Reference


Practical Express.js Backend Example

Here is an example showing how to serve stream links to your client web application while handling custom CDN playback headers and subtitle merging:

SDK vs Self-Hosted API

The SDK and the self-hosted API server provide the same streaming functionality but in different deployment models: Choose the SDK if you want to integrate streaming directly into an existing Node.js application. Choose the self-hosted API if you want a standalone streaming service that can be used by multiple clients.