To use the Chunkify API in server-side JavaScript environments like
Node.js or Bun, you can use the official Chunkify SDK for TypeScript.
Get started by installing the SDK using npm.
npm install @chunkify/chunkify
Now create a file called example.ts and paste the following code:
import Chunkify from '@chunkify/chunkify';
const client = new Chunkify({
projectAccessToken: 'My Project Access Token',
});
// Create a source from a hosted file
const source = await client.sources.create({
url: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
});
console.log(source);
Execute the code with bun run example.ts (or the equivalent command) and you should see the details of your newly created source.
Learn more on GitHub
Discover more about the Chunkify SDK for TypeScript on the library's GitHub page.
To use the Chunkify API in Python, you can use the official Chunkify SDK for Python.
Get started by installing the SDK using pip.
pip install chunkify-sdk
Now create a file called example.py and paste the following code:
from chunkify import Chunkify
client = Chunkify(
project_access_token="My Project Access Token",
)
# Create a source from a hosted file
source = client.sources.create(
url='https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
);
print(source);
Execute the code with python example.py and you should see the details of your newly created source.
Learn more on GitHub
Discover more about the Chunkify SDK for Python on the library's GitHub page.
To use the Chunkify API in PHP, you can use the official Chunkify SDK for PHP.
Get started by installing the SDK using Composer.
composer require chunkify/chunkify-php
Now create a file called example.php and paste the following code:
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Chunkify\Client;
$client = new Client(
projectAccessToken: 'My Project Access Token',
);
// Create a source from a hosted file
$source = $client->sources->create(
url : 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
);
// You can access the source specs
print_r($source);
Execute the code with php example.php and you should see the details of your newly created source.
Learn more on GitHub
Discover more about the Chunkify SDK for PHP on the library's GitHub page.
To use the Chunkify API in Go, you can use the official Chunkify SDK for Go.
Get started by installing the SDK using go get.
go get -u github.com/chunkifydev/chunkify-go
Now create a file called example.go and paste the following code:
import(
"context"
"fmt"
"github.com/chunkifydev/chunkify-go"
"github.com/chunkifydev/chunkify-go/option"
)
client := chunkify.NewClient(
option.WithProjectAccessToken("My Project Access Token"),
)
// Create a source from a hosted file
source, err := client.Sources.New(context.TODO(), chunkify.SourceNewParams{
URL: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v", source)
Execute the code with go example.go and you should see the details of your newly created source.
Learn more on GitHub
Discover more about the Chunkify SDK for Go on the library's GitHub page.