Skip to main content
This feature is currently in Private Preview. Access is limited to selected users. Features and APIs may change without notice.

Overview

The Giselle SDK (@giselles-ai/sdk) provides a simple, type-safe way to interact with the Giselle API from your Node.js applications. It handles authentication, request formatting, and polling for task completion automatically.
The SDK is designed for server-side use only. Never use it in client-side code (browsers) as this would expose your API key.

Installation

The Giselle SDK is published on npm at @giselles-ai/sdk. Install the SDK using your preferred package manager:

Quick Start

Configuration

Constructor Options

Environment Variables

We recommend storing your API key in an environment variable:
Never commit API keys to version control. Use environment variables or a secrets manager.

API Reference

client.apps.run()

Starts an app execution and returns immediately with a task ID. Use this when you want to handle polling yourself or don’t need to wait for results.
Parameters: Returns:

client.apps.runAndWait()

Starts an app execution and polls until the task completes. This is the recommended method for most use cases.
Parameters: Returns: The task type in the return value differs depending on the End Node’s Output Format setting. Raw (passthrough):
JSON (object):

Finding Your App ID and Code Snippet

The easiest way to get your App ID and a ready-to-use code snippet is from the Workspace:
  1. Open your app in the Workspace
  2. Click the Run button in the top-right corner
  3. In the dialog that appears, select the Code tab
  4. You’ll see a complete code snippet with your appId already filled in. Simply copy this code and use it in your application.
  5. If the End Node has JSON (Structured Output) enabled, the Code tab also displays a code snippet with schema definitions and a preview of the Response JSON structure
The App ID format is app_ followed by a unique identifier (e.g., app_abc123xyz).

Error Handling

The SDK throws specific error types for different failure scenarios:

Error Types

Examples

Basic Usage

Receiving Structured Output

When the End Node has JSON (Structured Output) enabled, task.outputType === "object" and task.output contains the structured result.
Pass a Standard Schema v1 compatible schema to the schema parameter to automatically validate the output and get type inference.
Supported libraries: Zod (3.24+), Valibot (1.0+), ArkType (2.0+), Yup (1.7+), Effect Schema (3.13+)

With Custom Timeout

Fire and Forget

Express.js Integration

Current Limitations

  • Text input only: Currently, only text input is supported. File inputs will be supported in a future release.
  • Server-side only: The SDK should only be used in server-side environments to protect your API key.

Next Steps