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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@getvrex/glabs-sdk

v2.2.2

Published

TypeScript SDK for Google Labs AI media generation APIs

Readme

GLabs SDK

TypeScript SDK and CLI for Google Labs AI media generation — Imagen 4 image generation and Veo 3.1 video generation.

Packages

| Package | Description | Install | |---------|-------------|---------| | @getvrex/glabs-sdk | SDK for programmatic usage | npm install @getvrex/glabs-sdk | | @getvrex/glabs-cli | Global CLI | npm install -g @getvrex/glabs-cli |

CLI

npm install -g @getvrex/glabs-cli
glabs <command> [subcommand] [options]

Commands:
  auth      extract             Extract tokens via browser automation
  config    show | set          Manage CLI configuration
  projects  list | get          Manage projects
  images    generate | upload | upsample | credits
  videos    generate | i2v | r2v | extend | reshoot | upsample | status | poll
  whisk     generate            Whisk image generation (Imagen 3.5)
  serve                         Start OpenAI-compatible server

Setup

# Extract tokens automatically
glabs auth extract --email [email protected] --password "pass" --save

# Or set tokens manually
glabs config set --bearer-token "tok" --session-token "stok" --account-tier pro

Usage Examples

# Generate images
glabs images generate -p "A sunset over mountains" -a 16:9 -n 4

# Generate video from text
glabs videos generate -p "A cinematic drone shot of a city" -a 16:9

# Generate video from image
glabs videos i2v -p "Camera pans slowly" --start-media-id "abc123"

# Poll and download video
glabs videos poll --operation-name "operations/xyz" -o ./videos

# Start OpenAI-compatible server
glabs serve --port 8000 --api-key "sk-my-key"

SDK

npm install @getvrex/glabs-sdk

Quick Start

import { GLabsClient } from '@getvrex/glabs-sdk';

const client = new GLabsClient({
  bearerToken: 'your-bearer-token',
  sessionToken: 'your-session-token',
  accountTier: 'pro',
  recaptcha: { provider: 'chrome' },
});

// Generate an image
const image = await client.images.generate({
  prompt: 'A beautiful sunset over mountains',
  sessionId: GLabsClient.generateSessionId(),
  aspectRatio: '16:9',
});

// Generate a video
const operation = await client.videos.generateTextToVideo({
  prompt: 'A cinematic drone shot of a city',
  sessionId: GLabsClient.generateSessionId(),
  aspectRatio: '16:9',
});

// Poll until ready
const video = await client.videos.pollOperation({
  operationName: operation.operationName,
  onProgress: (status, attempt) => console.log(`[${attempt}] ${status.status}`),
});

console.log('Video URL:', video.videoUrl);
await client.close();

Image Generation

Models: nanobanana2 (default, NARWHAL), nanobananapro (GEM_PIX_2), imagen-4 / imagen-4-fast / imagen-4-ultra (IMAGEN_3_5)

client.images.generate(opts)       // Text-to-image (up to 4 per batch)
client.images.upload(opts)         // Upload for video generation
client.images.upsampleImage(opts)  // Upscale to 2K/4K
client.images.getCreditStatus()    // Check account credits

Video Generation (Veo 3.1)

client.videos.generateTextToVideo(opts)          // Text-to-video
client.videos.generateImageToVideo(opts)          // Image-to-video (start or first+last frame)
client.videos.generateReferenceImagesVideo(opts)  // Multi-reference image video (1-3 images)
client.videos.extend(opts)                        // Extend existing videos
client.videos.reshoot(opts)                       // Camera control reshoot (14 motion types)
client.videos.upsample(opts)                      // Upscale to HD/4K
client.videos.checkStatus(opts)                   // Check generation status
client.videos.pollOperation(opts)                 // Poll until completion

Project Management

client.projects.list()              // List projects
client.projects.get({ projectId })  // Get project details
client.projects.getFirstProjectId() // Auto-resolve (cached)

All generation methods auto-select the first project if none is provided.

OpenAI-Compatible Server

import { GLabsClient } from '@getvrex/glabs-sdk';
import { OpenAIServer } from '@getvrex/glabs-sdk/openai';

const server = new OpenAIServer(new GLabsClient({ ... }), {
  port: 8000,
  apiKey: 'sk-xxx',
});
await server.start();
// POST /v1/chat/completions
// GET  /v1/models

Whisk (Imagen 3.5)

import { WhiskService } from '@getvrex/glabs-sdk';

const whisk = new WhiskService('your-cookie-string');
const result = await whisk.generateImage('A cute robot');

Configuration

const client = new GLabsClient({
  bearerToken: string,           // Required: auth token
  sessionToken?: string,         // Auto token refresh (ST -> AT)
  accountTier?: 'pro' | 'ultra', // Default: 'pro'
  projectId?: string,            // Auto-resolved if omitted
  recaptcha?: RecaptchaConfig,   // Required for generation
  timeout?: number,              // Request timeout ms (default: 120000)
  maxRetries?: number,           // Network retries (default: 2)
  retryDelay?: number,           // Retry delay ms (default: 1500)
});

reCAPTCHA Providers

| Provider | Type | Note | |----------|------|------| | chrome | Browser | Recommended — real Chrome, highest scores | | yescaptcha | Cloud | Recommended — no local browser needed | | playwright | Browser | Playwright-managed browser | | regotcha | Cloud | Optimized for Google Labs | | capsolver | Cloud | Proxy support | | veo3solver | Token | Pre-solved tokens via JWT | | custom | Self-hosted | Your own solver endpoint |

Fallback chains:

recaptcha: {
  provider: 'chrome',
  fallback: { provider: 'yescaptcha', apiKey: 'key' },
}

Token Management

With sessionToken configured, the SDK automatically refreshes the bearer token before expiry, retries on 401, and deduplicates concurrent refresh calls.

Account Tiers

| Feature | Pro | Ultra | |---------|-----|-------| | Default Video Mode | fast | quality | | HD/4K Upscaling | Yes | Yes | | Max Images/Batch | 4 | 4 |

Types

import type {
  AccountTier, AspectRatio, GenerateImageOptions,
  GenerateTextToVideoOptions, VideoStatusResult,
  RecaptchaConfig, Project, OpenAIServerConfig,
} from '@getvrex/glabs-sdk/types';

Error Handling

import { GLabsError } from '@getvrex/glabs-sdk';

try {
  await client.images.generate({ ... });
} catch (error) {
  if (error instanceof GLabsError) {
    console.error(`[${error.code}] ${error.message}`, error.statusCode);
  }
}

Claude Code Skill

Install the glabs-cli skill for Claude Code AI assistance:

curl -fsSL https://raw.githubusercontent.com/getvrex/glabs-sdk/main/scripts/install-skill.sh | bash

Documentation

Full docs: docs/

| Guide | Description | |-------|-------------| | Getting Started | Installation and setup | | CLI | Command-line interface | | Client | Client configuration | | Image Generation | Image API | | Video Generation | Video API | | Project Management | Project API | | reCAPTCHA | reCAPTCHA integration | | OpenAI Server | OpenAI-compatible server | | Token Management | Auto token refresh | | Whisk | Whisk image generation | | Error Handling | Error codes | | API Reference | Complete API reference |

License

MIT