Node.js Video Editor

A Node.js video editor for building video centric applications and workflows. The Shotstack API is a cloud video editor accessed via a Node.js SDK.

Editing video using Node.js


Used every day by developers at businesses large and small

Coca Cola

The Shotstack Node.js video SDK makes it quick and easy to set up a Node based video editor that can be integrated in to your applications in days, not months.

The video editing package is open-source, available as an NPM module or directly from GitHub. The SDK works directly with the Shotstack video editing API which is a fully managed, cloud hosted service that removes the need to compile and install software, manage Lambdas, containers or servers.

Shotstack ships with all the essential video editing features you need, including cut and trim, stitching clips, transitions, filters and effects and lets you merge videos, images, text and audio. All accessible using familiar JavaScript, JSON and Node.js.


The Shotstack Node.js video editing library is available as an NPM module and can be installed directly from NPM or downloaded from GitHub.

npm install shotstack-sdk


1. Require the library

Require the library in to your script.

const Shotstack = require('shotstack-sdk');
2. Configure the API client

Set the base path of the API client to point to either the stage sandbox or v1 production environment.

const defaultClient = Shotstack.ApiClient.instance;
defaultClient.basePath = '';
3. Authenticate

Set the API key using your own key which you will receive when you register. You should load the key using environment variables in a production environment.

const DeveloperKey = defaultClient.authentications['DeveloperKey'];
DeveloperKey.apiKey = 'H7jKyj90kd09lbLOF7J900jNbSWS67X87xs9j0cD';
4. Trim a video clip

The API supports a full range of video editing features but to keep things simple, this example shows how to trim a video clips start and end point. Set the video asset trim to 3 to cut the first 3 seconds off the start and then play the next 8 seconds by setting the length to 8. Setting the start to 0 means the video clip start straight away.

let videoAsset = new Shotstack.VideoAsset;

let videoClip = new Shotstack.Clip;
5. Add the clip to a track

A track is like a layer that can contain clips layered on top of each other, for examples; text over a video. This video just has one clip which is added to a single track.

let track = new Shotstack.Track;
6. Add the track to the timeline

The timeline specifies all the tracks, as an array, that make up the final video edit.

let timeline = new Shotstack.Timeline;
7. Set the video output specification

Every video needs an output specification, here the format is set to mp4 and the resolution to SD.

let output = new Shotstack.Output;
8. Create the video edit

The final edit is made up of the timeline and the output format.

let edit = new Shotstack.Edit;
9. POST the edit to the API

The SDK takes care of converting the edit to JSON and posts it to the API for rendering returning a Promise.

const api = new Shotstack.EditApi();
api.postRender(edit).then((render) => {
10. Get the rendered video URL

Finally, check the status of the render and when done output the video URL. Modify the request from step 9 and add the status check inside the render response.

const api = new Shotstack.EditApi();
api.postRender(edit).then((render) => {
api.getRender( => {
if (data.response.status === 'done') {


The Node.js code above prepares a JSON payload, describing the video editing parameters to trim a video clip, POST's it to the Shotstack API and generate this video.


Check our Node.js video editing examples and demos on GitHub


See what the Shotstack API and Node.js can do

This application is the perfect example of a well executed and documented API. In less than 10 mins, set up, web hook done, and first render! Mike Maberry,
There are a couple of other options out there that attempt to provide the same or similar solution, but none of them come close in terms of quality, ease of use, and speed. Adam Chubbuck, Software Engineer
Shotstack was EXACTLY what I was looking for, and incredibly easy to get started with. You guys are killing it. Colin Plamondon,

Experience Shotstack for yourself, with no risk, and generate your first video in 15 minutes.