Getting Started
Install and configure the GLabs SDK
Getting Started
This guide will help you install and configure the GLabs SDK in your project.
Installation
Install the package using your preferred package manager:
This is a private package. Configure your .npmrc:
Prerequisites
Before using the SDK, you'll need:
- Bearer Token - A valid authentication token from Google Labs
- reCAPTCHA Provider (Required) - An API key from Regotcha, CapSolver, or YesCaptcha for solving reCAPTCHA challenges. Both image and video generation require reCAPTCHA verification.
- Project ID - Your Google Labs project identifier (optional, can be provided per-request or auto-resolved)
Basic Setup
Environment Variables
We recommend using environment variables for sensitive configuration:
Session Management
Each API request requires a session ID. You can generate one using the static method:
Or you can use your own UUID generation:
Error Handling
The SDK throws GLabsError for API errors: