npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ververv/oaktis-sdk

v0.1.12

Published

Official JavaScript/TypeScript SDK for Oaktis - AI-powered image & video generation

Readme

@ververv/oaktis-sdk

🔗 Try Oaktis → https://oaktis.com

Official JavaScript/TypeScript SDK for Oaktis - AI-powered image & video generation.

npm version License: MIT

Features

  • 🎬 Video Generation - Create AI-powered videos from text prompts
  • 🖼️ Image Generation - Generate images with advanced AI models
  • 📝 TypeScript Support - Full type definitions included
  • 🔄 Job Management - Track generation progress with status polling
  • Modern API - Promise-based with async/await support
  • 🌐 Universal - Works in Node.js and browsers

Installation

npm install @ververv/oaktis-sdk

Or with yarn:

yarn add @ververv/oaktis-sdk

Or with pnpm:

pnpm add @ververv/oaktis-sdk

Quick Start

Video Generation

import { OaktisClient } from '@ververv/oaktis-sdk';

const client = new OaktisClient({
  apiKey: process.env.OAKTIS_API_KEY!
});

// Generate a video
const job = await client.video.generate({
  prompt: 'a cat surfing on ocean waves at sunset',
  duration: 5,
  resolution: '1080p'
});

console.log('Job ID:', job.id);

// Check job status
const status = await client.video.getStatus(job.id);
console.log('Status:', status.status);
console.log('Progress:', status.progress);

// Get completed job with video URL
if (status.status === 'completed') {
  const completedJob = await client.video.getJob(job.id);
  console.log('Video URL:', completedJob.videoUrl);
}

Image Generation

import { OaktisClient } from '@ververv/oaktis-sdk';

const client = new OaktisClient({
  apiKey: process.env.OAKTIS_API_KEY!
});

// Generate an image
const job = await client.image.generate({
  prompt: 'a futuristic city at night with neon lights',
  size: '1024x1024',
  n: 1
});

// Get completed job with image URLs
const completedJob = await client.image.getJob(job.id);
console.log('Image URLs:', completedJob.imageUrls);

Configuration

The OaktisClient accepts the following configuration options:

interface OaktisConfig {
  /** API Key for authentication (required) */
  apiKey: string;

  /** Base URL for the Oaktis API (optional, default: https://api.oaktis.com) */
  baseUrl?: string;

  /** Request timeout in milliseconds (optional, default: 60000) */
  timeout?: number;
}

Example with custom configuration:

const client = new OaktisClient({
  apiKey: 'your-api-key',
  baseUrl: 'https://custom-api.example.com',
  timeout: 120000 // 2 minutes
});

API Reference

Video API

client.video.generate(params)

Generate a video from a text prompt.

Parameters:

  • prompt (string, required) - Text description of the video
  • duration (number, optional) - Video duration in seconds
  • resolution ('720p' | '1080p' | '4k', optional) - Video resolution

Returns: Promise<VideoJob>

client.video.getStatus(jobId)

Get the status of a video generation job.

Returns: Promise<JobStatus>

client.video.getJob(jobId)

Get full details of a video job including the generated video URL.

Returns: Promise<VideoJob>

Image API

client.image.generate(params)

Generate an image from a text prompt.

Parameters:

  • prompt (string, required) - Text description of the image
  • size ('512x512' | '1024x1024' | '1024x1792' | '1792x1024', optional) - Image size
  • n (number, optional) - Number of images to generate

Returns: Promise<ImageJob>

client.image.getStatus(jobId)

Get the status of an image generation job.

Returns: Promise<JobStatus>

client.image.getJob(jobId)

Get full details of an image job including generated image URLs.

Returns: Promise<ImageJob>

Error Handling

The SDK throws APIError objects with the following structure:

interface APIError {
  code: string;
  message: string;
  status: number;
  details?: any;
}

Example error handling:

try {
  const job = await client.video.generate({ prompt: 'test' });
} catch (error) {
  if (error.code === 'UNAUTHORIZED') {
    console.error('Invalid API key');
  } else if (error.code === 'TIMEOUT') {
    console.error('Request timed out');
  } else {
    console.error('Error:', error.message);
  }
}

TypeScript Support

This package includes TypeScript type definitions. All types are exported from the main entry point:

import type {
  OaktisConfig,
  VideoGenerateParams,
  ImageGenerateParams,
  VideoJob,
  ImageJob,
  JobStatus,
  APIError
} from '@ververv/oaktis-sdk';

Links

License

MIT © Oaktis


Need an API key? Get started at oaktis.com