google-labs-code avatar

Stitch Sdk Usage

This wraps the Google Stitch SDK for generating UI screens from text prompts. You can create projects, upload mockup images, generate screens, iterate with edit and variant commands, and pull down the resulting HTML or screenshots. It's a programmatic interface for teams that want to embed AI UI generation into their own tooling rather than clicking through a web UI. The design system support lets you apply consistent themes across screens. Error handling is typed with StitchError, and there's a tool client mode if you're building agents that need to dynamically discover and call SDK methods. Straightforward TypeScript API that gets out of your way.

skills.sh installs
576
GitHub stars
1.8K
last updated
Aug 21, 2026

Install

$ npx -y skills add google-labs-code/stitch-sdk --skill stitch-sdk-usage --agent claude-code

Installs into .claude/skills of the current project.

Files

Using the Stitch SDK

The Stitch SDK provides a TypeScript interface for Google Stitch, an AI-powered UI generation service.

Installation

npm install @google/stitch-sdk

Environment Variables

export STITCH_API_KEY="your-api-key"

Quick Start

import { stitch } from "@google/stitch-sdk";

const project = await stitch.createProject({ title: "My App" });
const generation = await project.generate("A settings page with dark theme");
const screen = generation.first; // all screens: generation.screens
const html = await screen.getHtml(); // the HTML content
const png = await screen.getImage(); // screenshot bytes (Uint8Array)

The stitch singleton reads STITCH_API_KEY from the environment and connects on first use — no setup code required.

Working with Projects

import { stitch } from "@google/stitch-sdk";

// List all projects
const projects = await stitch.projects();

// Reference a project by ID (no network call)
const project = stitch.project("4044680601076201931");

// Create a new project
const newProject = await stitch.createProject({ title: "My App" });

Design Systems

Sponsors

Details

Repository
github.com/google-labs-code/stitch-sdk
Categories
Frontend Development, CLI & Terminal
First seen
Jun 3, 2026

More from google-labs-code/stitch-sdk

All 2
1cycleuser avatarofficial-document-writercycleuser/skillsOfficial document writing assistant for Chinese government documents based on GB/T 9704-2012 standard. Triggers when: Writing Chinese official documents (公文), f573skills.sh installs
2openclaudia avatargoogle-adsopenclaudia/openclaudia-skillsWrite Google Ads copy and build campaign structures. Use when the user asks to create Google Ads, write ad copy for search or display, set up PPC campaigns, opt570skills.sh installs
3aj-geddes avatarbundle-size-optimizationaj-geddes/useful-ai-promptsReduce JavaScript and CSS bundle sizes through code splitting, tree shaking, and optimization techniques. Improve load times and overall application performance567skills.sh installs
4nodeops-app avatarnodeops-authnodeops-app/skillsAdd NodeOps PKCE OAuth authentication to a Next.js app. Trigger when the user wants to set up NodeOps login, integrate NodeOps OAuth, add @nodeops-createos/inte564skills.sh installs
5pproenca avatarexpopproenca/dot-skillsExpo React Native performance optimization guidelines. This skill should be used when writing, reviewing, or refactoring Expo React Native code to ensure optima561skills.sh installs
6jezweb avatarwordpress-plugin-corejezweb/claude-skillsBuild secure WordPress plugins with hooks, database interactions, Settings API, custom post types, and REST API. Covers Simple, OOP, and PSR-4 architecture patt560skills.sh installs