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.
Changelog
All notable changes to this project will be documented in this file.
[2.0.8]
Fixed
- Response validation no longer fails under zod ≥ 4.4.0.
zod
4.4.0changed object parsing so that a missing optional key whose value schema is aunioncontainingundefinedwas treated as required (expected: "nonoptional"). Because the SDK declared zod loosely (^4.0.0), fresh installs pulled4.4.xand threwResponseValidationErroron valid HTTP 200 responses that omitted optional fields (e.g.summary,chapters,namedEntities,moderationon media responses when those AI features are not enabled).- Root-cause fix: the internal
optional()helper now wraps fields inz.optional(...), so optional keys are treated as optional on every zod version (verified on 4.3.6 and 4.4.3). - Defense in depth: the
zoddependency range is capped to^3.25.65 || >=4.0.0 <4.4.0so installs resolve to a known-good version automatically.
- Root-cause fix: the internal
- Webhook signing secret no longer logged. Removed two debug
console.logstatements insrc/sdk/webhooks.tsthat printed the signing secret and raw payload. - Webhook module type resolution. Added a
node:types reference sonode:crypto/node:bufferimports resolve in editors/type-checks.
Changed
- Dependency cleanup. Removed the bogus
cryptonpm package (the deprecated registry stub —node:cryptois built in), removed the accidental self-dependency on@fastpix/fastpix-node, and moveddotenvtodevDependencies. The published package now declares onlyzodas a runtime dependency. - SDK version bump:
2.0.7→2.0.8(sdkVersionconstant andUser-Agentheader updated accordingly).
Compatibility
- No changes to public types, method signatures, request/response models, default server URLs, hooks, or retry logic. No action required beyond updating the dependency.
[2.0.7]
Changed
-
SDK version bump:
2.0.6→2.0.7. A maintenance release that updates the SDK’s internal version identifiers. It contains no functional, API, or behavioral changes and is fully backward compatible with2.0.6.Updated identifiers:
sdkVersionconstant — now reports2.0.7(the internal identifiers were previously lagging at2.0.5; they are now aligned with the package version).User-Agentheader — outbound requests now identify asfastpix-sdk/typescript 2.0.7.
Compatibility
- No changes to public types, method signatures, request/response models, default server URLs, hooks, or retry logic.
- No action required for existing integrations — update the dependency and rebuild.
[2.0.6]
⚠️ Important — FastPix is migrating from .io to .com
All FastPix hosts and documentation links are moving to the .com TLD:
The .io hosts continue to serve traffic during the transition, but they are slated for deprecation soon — please update any hard-coded references in your application as part of your next deploy. We strongly recommend upgrading to this SDK release (or later) across every language you use — every official FastPix SDK is being rolled out with the same migration.
What this means for users of @fastpix/fastpix-node:
- If you rely on SDK defaults, no code change is required. The default
serverURLishttps://api.fastpix.com/v1/, so bumping to2.0.6and runningnpm installis enough. - If you have an explicit
serverURLoverride (e.g.new Fastpix({ serverURL: "https://api.fastpix.io/v1/" })), change it tohttps://api.fastpix.com/v1/. - If you reference FastPix asset URLs directly in your app (HLS playback URLs, image CDN, dashboard deep links), update those to the
.comequivalents before.iois decommissioned.
All README and per-SDK doc links in this package have been updated to point at the new https://fastpix.com/docs/... URLs.
Fixed (SDK ↔ API parity)
views.list(/data/viewlist): added the previously-missingerrorIdfield on each view entry, and stopped renamingQoeScoretoqoeScoreso the SDK output matches the API response byte-for-byte.views.getDetails:data.fpSdk/data.fpSdkVersionare no longer renamed tofpSDK/fpSDKVersion— the SDK now preserves the wire-format casing returned by the API.media.list(/on-demand): tracks now includeframeRate, which was being silently dropped by the previous SDK build.playback.create(/on-demand/{mediaId}/playback-ids): responsedata.resolutionis now correctly modelled as nullable — it isnullwhen no resolution constraint was set at create time.signingKeys.delete: response shape now includes the optionaldata.messageconfirmation string the API has been returning.- OpenAPI
tracks[].typefield forVideoTrack/VideoTrackForGetAll/AudioTrack/SubtitleTrackis now a properenum(video/audio/subtitle) so language generators can discriminate the union correctly. - OpenAPI
maxDuration.minimumon live-stream schemas relaxed from60to0to reflect the API’s “unbounded” sentinel value.
Docs
- All README and per-service documentation pages updated from
docs.fastpix.io/...anddocs.fastpix.com/...to the newhttps://fastpix.com/docs/...URL structure.
[2.0.5]
Fixed
- Fixed
views.getDetailsdata.events[]returning empty objects and emitting phantomnulltimestamps.
[2.0.4]
Fixed
- Fixed missing parameters in multiple API methods.
- Improved overall developer experience through more accurate typings.
[2.0.3]
Changed
- Updated npm authentication from Classic token to Granular token for improved security and fine-grained permissions.
[2.0.2]
Fixed
- Adjusted the code samples in the README.md
- Modified
getDrmConfigurationmethod as a bug fix.
[2.0.1]
Changed
- Added keywords to
package.jsonand updated the README.md redirection link.
[2.0.0] - Major Feature Release
This release introduces a wide set of new APIs, significantly expanding the SDK’s capabilities across On Demand, Live Stream, SigningKeys, and Video Data domains.
Media API
Extended functionality for managing media with advanced processing, playlist management, and DRM support:
updateMediaSummary- Generate video summaries for quick insightsupdateMediaChapters- Automatically generate structured video chaptersupdateMediaNamedEntities- Extract named entities for video intelligenceupdateMediaModeration- Enable video moderation features for complianceaddMediaTrack- Add audio/subtitle trackscancelUpload- Cancel ongoing uploads gracefullyupdateMediaTrack- Update audio/subtitle tracksdeleteMediaTrack- Remove audio/subtitle tracksgenerateSubtitleTrack- Auto-generate subtitlesupdatedSourceAccess- Update media source access permissionsupdatedMp4Support- Toggle MP4 support for a mediaretrieveMediaInputInfo- Fetch media input informationlistUploads- Retrieve all unused upload URLsgetMediaClips- List clips of a media- Playlist Management:
createAPlaylist,getAllPlaylists,getPlaylistById,updateAPlaylist,deleteAPlaylist,addMediaToPlaylist,changeMediaOrderInPlaylist,deleteMediaFromPlaylist
- DRM Management:
getDrmConfiguration,getDrmConfigurationById
Live API
Added fine-grained stream control:
enableLiveStream- Enable a streamdisableLiveStream- Disable a streamcompleteLiveStream- Mark a live stream as completed
SigningKey API
Introduced secure signing key management:
createSigningKey- Create signing keys for secure token usagelistSigningKeys- List available signing keysdeleteSigningKey- Revoke signing keysgetSigningKeyById- Retrieve signing key details
Data API
New analytics endpoints for tracking and measuring performance:
listVideoViews- List video viewsgetVideoViewDetails- Fetch detailed video view informationlistByTopContent- Discover top-performing contentgetDataViewlistCurrentViewsGetTimeseriesViews- Retrieve concurrent viewers timeseriesgetDataViewlistCurrentViewsFilter- Breakdown concurrent viewers by dimensionlistDimensions- List all available dimensionslistFilterValuesForDimension- List filter values per dimensionlistErrors- Retrieve error logslistBreakdownValues- Get breakdown metricslistOverallValues- Get overall summary metricsgetTimeseriesData- Access timeseries datalistComparisonValues- Compare metrics across datasets
[1.0.2] - Metadata Update
- Updated
package.jsonwith keywords related to FastPix Node.js API SDK for better discoverability.
[1.0.1] - Documentation Update
- Improved
README.mdwith clearer usage instructions and examples.
[1.0.0] - Initial Release
- First release of the FastPix Node.js API SDK.
- Provides a robust foundation for interacting with the FastPix API.
- Media API: Upload media, manage media assets (list, fetch, update, delete), and generate playback IDs.
- Live API: Create, list, update, and delete live streams; generate and manage playback IDs; and simulcast to multiple platforms.