Build something great. Vimeo's API supports flexible, high-quality video integration with your custom apps.
The SDK relies on Node.js and npm (to resolve dependencies). It also requires Typescript version >=4.1. You can download and install Node.js and npm from the official Node.js website.
NOTE: npm is installed by default when Node.js is installed.
Run the following commands in the command prompt or shell of your choice to check if Node.js and npm are successfully installed:
-
Node.js:
node --version -
npm:
npm --version
- To resolve all dependencies, go to the SDK root directory and run the following command with npm:
npm install- This will install all dependencies in the node_modules folder.
The following section explains how to use the generated library in a new project.
-
Open an IDE/text editor for JavaScript like Visual Studio Code. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
-
Click on File and select Open Folder. Select an empty folder of your project, the folder will become visible in the sidebar on the left.
- To initialize the Node project, click on Terminal and select New Terminal. Execute the following command in the terminal:
npm init --y- The created project manages its dependencies using its
package.jsonfile. In order to add a dependency on the Vimeo APILib client library, double click on thepackage.jsonfile in the bar on the left and add the dependency to the package in it.
- To install the package in the project, run the following command in the terminal:
npm installNote: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
|---|---|---|
| timeout | number |
Timeout for API calls. Default: 30000 |
| httpClientOptions | Partial<HttpClientOptions> |
Stable configurable http client options. |
| unstableHttpClientOptions | any |
Unstable configurable http client options. |
| logging | PartialLoggingOptions |
Logging Configuration to enable logging |
| bearerCredentials | BearerCredentials |
The credential object for bearer |
| oauth2AuthorizationCodeCredentials | Oauth2AuthorizationCodeCredentials |
The credential object for oauth2AuthorizationCode |
| oauth2ClientCredentialsCredentials | Oauth2ClientCredentialsCredentials |
The credential object for oauth2ClientCredentials |
The API client can be initialized as follows:
import {
Client,
LogLevel,
OauthScopeOauth2AuthorizationCode,
OauthScopeOauth2ClientCredentials,
} from 'vimeo-apilib';
const client = new Client({
bearerCredentials: {
accessToken: 'AccessToken'
},
oauth2AuthorizationCodeCredentials: {
oauthClientId: 'OAuthClientId',
oauthClientSecret: 'OAuthClientSecret',
oauthRedirectUri: 'OAuthRedirectUri',
oauthScopes: [
OauthScopeOauth2AuthorizationCode.Ai,
OauthScopeOauth2AuthorizationCode.Create
]
},
oauth2ClientCredentialsCredentials: {
oauthClientId: 'OAuthClientId',
oauthClientSecret: 'OAuthClientSecret',
oauthScopes: [
OauthScopeOauth2ClientCredentials.Ai,
OauthScopeOauth2ClientCredentials.Create
]
},
timeout: 30000,
logging: {
logLevel: LogLevel.Info,
logRequest: {
logBody: true
},
logResponse: {
logHeaders: true
}
},
});import * as path from 'path';
import * as fs from 'fs';
import { Client } from 'vimeo-apilib';
// Provide absolute path for the configuration file
const absolutePath = path.resolve('./config.json');
// Read the configuration file content
const fileContent = fs.readFileSync(absolutePath, 'utf-8');
// Initialize client from JSON configuration content
const client = Client.fromJsonConfig(fileContent);See the Configuration-Based Client Initialization section for details.
import * as dotenv from 'dotenv';
import * as path from 'path';
import * as fs from 'fs';
import { Client } from 'vimeo-apilib';
// Optional - Provide absolute path for the .env file
const absolutePath = path.resolve('./.env');
if (fs.existsSync(absolutePath)) {
// Load environment variables from .env file
dotenv.config({ path: absolutePath, override: true });
}
// Initialize client using environment variables
const client = Client.fromEnvironment(process.env);See the Environment-Based Client Initialization section for details.
This API uses the following authentication schemes.
bearer (OAuth 2 Bearer token)oauth2_authorization_code (OAuth 2 Authorization Code Grant)oauth2_client_credentials (OAuth 2 Client Credentials Grant)
- API Apps Webhooks
- API Information Essentials
- Authentication Extras Authenticate
- Authentication Extras Convert
- Authentication Extras Essentials
- Authentication Extras Exchange
- Channels Privatechannelmembers
- Channels Subscriptionsandsubscribers
- Embed Presets Customlogos
- Embed Presets Essentials
- Embed Presets Folders
- Embed Presets Timelineevents
- Embed Presets Videos
- Live Audiotracks
- Live Embedprivacy
- Live Event M3 U8 Playback
- Live Eventactivation
- Live Eventautomatedclosedcaptions
- Live Eventdestinations
- Live Eventend
- Live Eventlowlatency
- Live Eventsessions
- Live Eventthumbnails
- Live Eventvideos
- On Demand Backgrounds
- On Demand Essentials
- On Demand Genres
- On Demand Posters
- On Demand Promotions
- On Demand Purchasesandrentals
- On Demand Regions
- On Demand Seasons
- On Demand Videos
- Showcases Customshowcaselogos
- Showcases Customshowcasethumbnails
- Showcases Showcasevideos
- Subscription Plans Essentials
- Users Watchhistory
- Videos Animatedthumbnails
- Videos Contentratings
- Videos Creative Commons
- Videos Embedprivacy
- Videos Live M3 U8 Playback
- Videos Nondestructivetrimming
- Videos Texttracks
- Videos Unlistedvideos
- Videos Videocomments
- Watch Later Queue Essentials
- Categories Channels
- Categories Essentials
- Categories Groups
- Categories Users
- Categories Videos
- Channels Categories
- Channels Essentials
- Channels Moderators
- Channels Tags
- Channels Videos
- Folders Essentials
- Folders Items
- Folders Videos
- Groups Essentials
- Groups Subscriptions
- Groups Users
- Groups Videos
- Likes Essentials
- Live Analytics
- Live Essentials
- Live Graphics
- Live Scenes
- Payments Essentials
- Portfolios Essentials
- Portfolios Videos
- Search Federated
- Showcases Essentials
- Tags Essentials
- Teams Essentials
- Teams Members
- Tutorial Essentials
- Users Analytics
- Users Essentials
- Users Feeds
- Users Followers
- Users LMS
- Users Pictures
- Users Search
- Videos AI
- Videos Chapters
- Videos Credits
- Videos Essentials
- Videos Fragments
- Videos Languages
- Videos Moderation
- Videos Recommendations
- Videos Showcases
- Videos Tags
- Videos Thumbnails
- Videos Transcripts
- Videos Uploads
- Videos Versions