Upload a Video Using Node.Js Vimeo Library
Learn to upload a video and generate a playable link using the library.
We'll cover the following
Overview
Till now, we have been calling REST endpoints directly to get familiarized ourselves with Vimeo APIs. In this lesson, we'll use the official Node.Js library provided by Vimeo to get a hands-on experience with authentication and working with the library. Libraries provide wrapper functions for the user and hide all the extra code from the user. We'll upload a video to our Vimeo account and then make some edits to it.
We have already set up Node.js and Vimeo libraries on Educative’s platform for this course. We just need to import the Vimeo library into our code and instantiate an object to call library functions. Node.Js library can be used to achieve the tasks we have performed using direct API calls, and we'll upload a video using the library to show its functionality.
Upload a video
In this section, we'll upload a video to our Vimeo account by calling the upload
function on the Vimeo object. We need a client ID, client secret, and access token for authorization purposes. Since we have already created our application in Get Started with the Vimeo API lesson, we just need to copy them from the My Apps page and paste them into the code widget below. Please replace the {clientID}
placeholder on line 3 with the value of "Client identifier," {clientSecret}
on line 4 with the value of "Client secrets," and we have already saved the access token previously.
Note: Since we are using the free account, we can upload a maximum of 10 videos per day.
Get hands-on with 1400+ tech skills courses.