Open source
Node.js video SDK
Easily build video experiences into your Node.js app with the FastPix Node.js video SDK.
Trusted by product teams shipping video at scale







What you get
Everything your Node.js app needs for video
Upload it, encode it, stream it, and see how it is doing. That is the whole job, and it all comes from one package you install like any other.
Getting video in is the easy part. Use a file you already host, or send one straight from your app. Nothing to store in between.
Your video plays on the web, on phones, on tablets and on TVs, and you never build a separate player for any of them.
Everyone watching gets a version that suits their screen, their browser and how fast their connection happens to be that day.
You can see how your video is actually doing, because the numbers come with it instead of being sold to you separately.
Install
Node.js SDK installation
Install the package with npm, pnpm, bun or yarn, whichever your project already uses. It needs Node.js 18 or newer. Everything the client can do is listed in the Node.js SDK docs.
Every endpoint underneath the SDK is listed in the API reference.
# Installs the client and its type definitions
npm install @fastpix/fastpix-node
# pnpm, bun and yarn all work too
pnpm add @fastpix/fastpix-node
yarn add @fastpix/fastpix-nodeCredentials
Your access tokens
FastPix gives you two values, not one key. They go in a security object on the constructor, and the client sends them as HTTP Basic on every request. Read them from process.env and keep them server-side. Get them from the access-token page in your dashboard.
Generate both on the access-token page in your dashboard. A free account issues a working pair straight away.
import { Fastpix } from "@fastpix/fastpix-node";
// Authenticates every request that follows, over HTTP Basic
const fastpix = new Fastpix({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});Open source
The Node.js SDK on GitHub
The code is public and Apache-2.0 licensed, so you can read exactly what it sends before you depend on it. Issues, pull requests and forks are welcome here and on every other package FastPix publishes.
Or browse All FastPix repos
On-demand video
Video upload and playback
Give the create method a URL of a file you already host, or upload one from your app. It comes back encoded for every screen and connection, with an ID your player uses. Both calls are promises. Video on Demand covers the rest.
// 1. Hand FastPix a video to fetch and encode
const result = await fastpix.inputVideo.create({
inputs: [
{ type: "video", url: "https://static.fastpix.com/fp-sample-video.mp4" },
],
metadata: { "key1": "value1" },
});
// 2. Issue the ID a player streams from
const playback = await fastpix.playback.create({
mediaId: "your-media-id",
body: { accessPolicy: "public", resolution: "1080p" },
});Ask for more up front
Captions, chapters and In-Video AI metadata are requested while the video is added.
Public or signed
Decide per playback ID whether anyone can watch, or only a viewer holding your token.
Browser uploads
Pair with a client-side upload SDK for pause, resume and retry.
Encoding
Every video gets its own encode
Most platforms run every file through the same settings. FastPix looks at each video first and encodes it to suit, so the file comes out smaller and still looks the same.
A ladder shaped to the title
Rungs are chosen per video, not copied from a preset.
35% smaller, same picture
Measured against H.264, HEVC and AV1 at matched quality.
Video Data
Playback analytics, built in
You do not need another tool to see how your video is doing. Every play is recorded automatically in Video Data, and you read the numbers with the same client you used to upload.
// Averages the quality-of-experience score over the last 24 hours
const result = await fastpix.metrics.listOverallValues({
metricId: "quality_of_experience_score",
measurement: "avg",
timespan: "24:hours",
filterby: "browser_name:Chrome",
});Ten fields are yours
Tag sessions with your own account or plan ID and slice by them later.
Four query shapes
Overall, breakdown, timeseries and compare, all off the metrics namespace.
Into your warehouse
Views come back through the same client, so they land in BI.
Which QoE metrics actually deserve an alert is covered in this working reference.
How it works
What happens after you upload a video
You get a media ID back straight away, while the file is still being processed. FastPix encodes it, stores it and prepares it for delivery, then sends a webhook the moment it is ready to play.
Independent timings for encode and first frame are on the benchmark page, which also names the workloads where FastPix does not come first.
Live streaming from your Node.js app
Live uses the same client as on-demand. Ask for a stream key, point OBS, vMix, a phone or a hardware encoder at it, and FastPix takes care of the stream and the recording.
Questions developers ask
Node.js SDK questions, answered
How do I upload a video in Node.js?
Two ways. Give fastpix.inputVideo.create a URL of a file you already host, passed as an options object, and FastPix fetches it. Or open a direct upload, which returns a signed URL your own code sends the file to. The first suits a backend job, the second a user-facing form. Both hand back a media ID.
Do I need FFmpeg to handle video in Node.js?
No. Most Node video tutorials reach for fluent-ffmpeg, which means a transcoding binary on your box and a worker to babysit it. FastPix encodes on its side, so your Node.js code only makes API calls. You never install FFmpeg, size a worker box, or maintain a rendition ladder for every device you care about.
How do I convert a video to HLS in Node.js?
You do not convert it yourself. fastpix.inputVideo.create creates the media entry, FastPix produces the HLS renditions, and fastpix.playback.create hands you the ID a player streams from. There is no ffmpeg command, no segmenting step and no manifest to write. Renditions are chosen per title rather than from a fixed preset, so a screen recording and an action scene do not get the same treatment.
Does the SDK work with Express, NestJS and Next.js?
Yes. It is a plain client with no framework coupling, so it drops into Express and Fastify routes, NestJS providers, Next.js route handlers and serverless functions alike. Build one client at module load and reuse it. In a bundle-sensitive runtime, reach for the standalone tree-shakable functions instead.
Documentation
Docs, references and guides
This page shows you the idea. When you need the exact parameter, the response or the error code, the docs have it, with an example you can run beside every operation.