Docs

SDKs

Install an official Chunkify SDK and make your first API request.

Use an official SDK to call the Chunkify API from your server. Choose your language below to install the SDK and create a Source from a hosted video.

Use the playback tracker for browser events and the Analytics Server SDKs to query playback reports or manage an Analytics Server.

Create a Project access token

In the Chunkify app, open your Project and go to Developers → API tokens. Click New Access Token and copy the token, which starts with sk_project_.

Replace My Project Access Token in the examples with your token. See API authentication for more information.

Keep access tokens on your server. Never expose them in browser code or commit them to source control.

Install and test your SDK

Each example creates a Source from a public sample video and prints its details.

The TypeScript SDK also supports server-side JavaScript. Use a supported Node.js or Bun version.

Install the SDK with npm:

npm install @chunkify/chunkify

Save the following as example.mjs. This JavaScript example runs in Node.js without a TypeScript build step:

import Chunkify from '@chunkify/chunkify';

const client = new Chunkify({
    projectAccessToken: 'My Project Access Token',
});

const source = await client.sources.create({
    url: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
});

console.log(source);

Run the example:

node example.mjs

With Bun, install using bun add @chunkify/chunkify and run using bun run example.mjs.

Learn more on GitHub

SDK documentation and examples for TypeScript.

Next steps

Follow Create your first video stream to create a video asset, receive its playback URL through a webhook, and play the video.