Before you start
Vyla SDK is for server-side Node.js. It contains provider integrations and makes outbound requests from the process where you install it. Do not import it into a browser bundle or expose provider results, credentials, or internal source keys directly to untrusted clients.
You need Node.js 18 or later and, for sources that resolve title metadata, a TMDB API key.
Install and initialize
Keep TMDB_API_KEY and any deployment configuration in server-side environment variables. Never commit them or send them to a client.
Resolve a movie
First inspect active providers. Provider availability changes over time, so select a key from the running configuration instead of hard-coding a placeholder.
155 is a TMDB movie ID. For an episode, include season and episode:
Make it resilient
Provider results are inherently variable: a source can fail, time out, return more than one candidate, or be temporarily disabled. In production:
- Probe sources or maintain a recent availability signal before choosing one.
- Give every provider call a request deadline in your application.
- Treat
allUrls as fallback candidates, not a guarantee that every URL will play.
- Return only the fields your client needs and validate requests at your own API boundary.
- Cache and rate-limit at your boundary to avoid repeatedly triggering upstream work.
Next steps
- Read the complete SDK reference for methods and return shapes.
- Learn provider flags, timeout behavior, and source keys in Providers.
- Choose Stream API only when an SSE HTTP interface better fits your client architecture.