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.
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: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.
Returns:
client.apps.runAndWait()
Starts an app execution and polls until the task completes. This is the recommended method for most use cases.
Returns:
The
task type in the return value differs depending on the End Node’s Output Format setting.
Raw (passthrough):
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:- Open your app in the Workspace
- Click the Run button in the top-right corner
- In the dialog that appears, select the Code tab
- You’ll see a complete code snippet with your
appIdalready filled in. Simply copy this code and use it in your application. - 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
- Create an API key to get started
- Test your apps in the Playground before integrating
- Check out Cookbooks for example apps and workflows