Node.js SDK
Add secure, scalable video to your Node.js project
The FastPix Node.js SDK gives you everything you need to manage video from your backend. Upload files from a public URL, attach metadata, and retrieve playback links, all without building encoding pipelines or managing storage. With this SDK, you can:
- Upload and organize video assets
- Define access control and metadata
- Generate HLS playback URLs
- Streamline video delivery from your Node.js server
Find more in the SDK reference
To explore more examples, API methods, and advanced usage, see the FastPix Node.js SDK on GitHub.
Prerequisites
Before you start using the FastPix Node.js SDK, make sure you have the following:
-
Node.js 18 or later: This SDK is compatible with Node.js 18 or higher. We recommend using Node.js 20+ for optimal performance and the latest language features.
-
Package manager: Ensure you have npm, yarn, or pnpm installed for dependency management.
-
FastPix API credentials: You’ll need an Access Token and a Secret Key (HTTP Basic Auth). You can generate these credentials by following the steps in the authentication guide.
-
Basic understanding of Node.js and REST APIs: Familiarity with Node.js development and API integration concepts.
Installation
Install the SDK using npm:
Import the SDK
Example
Let’s create a file named index.js
This example shows how to upload a video from a public URL with metadata and public access:
After the video is processed, you can use the media ID to fetch playback info, monitor status, or transform content via API.
Run the example
To execute the Node.js script, use the following command. Make sure to replace index.js with your actual file name if it’s different:
NOTE
Some methods might throw errors when you are on a trial plan.