Developer Reference
Technical reference for the hooks, APIs, components, routing patterns, and supported libraries available inside generated apps. Use these pages when you need imports, signatures, options, return values, and implementation examples.
Overview
Every app is a React app built from a single app.tsx file. Apps use Tailwind CSS for styling, local components for app-specific UI, and supported headless primitives for complex interactions, plus the platform hooks and APIs documented in this reference.
Apps can also use native browser APIs when they work inside the platform sandbox. Each app runs in an isolated, secure environment, and every user gets their own private database for that app. When someone else opens your app, they see and manage their own data, not the creator's data or another user's data.
Constraints and Limitations
Generated apps are designed to run on the platform, so some boundaries are intentional:
- Apps cannot be exported as standalone projects, pushed directly to GitHub, or run outside the platform.
- Apps use the curated platform library and supported packages instead of arbitrary external packages.
- Apps cannot connect directly to custom third-party APIs or services.
- User accounts, login, sessions, and app access are handled by the platform, not custom in-app authentication.
- Each user's database is private. Real-time collaboration, shared editing, and multi-user shared workspaces are not currently supported.
- Apps run in a secure sandbox, so browser capabilities may be limited where they would cross platform security boundaries.
- AI model access depends on the user's plan. Pinning a specific AI model disables automatic fallback for that request.
For the broader product-level list, see Platform Limitations.
Persistent Data
Persistent Data covers usePersistentItem, the app database hook for storing user data that should survive reloads and sync across devices. Use it for tasks, settings, saved outputs, history, preferences, and any other JSON-serializable data that belongs to the current user.
AI APIs
AI reference pages cover generation hooks, model selection helpers, supported inputs, and persistence patterns.
- AI Text:
useAIChat,useAIText,useAIObject, attachments, web search, schemas, andlistTextModels(). - AI Image:
useAIImage,useAIImageEdit, generated image return values, prompting, andlistImageModels(). - AI Video:
useSubmitVideoJob,useVideoJobStatus, video workflows, polling, model selection, and related video utilities. - AI Speech:
useAISpeech, generated audio return values, voices, providers, andlistSpeechModels().
Video workflows also use these client-side helpers (Experimental):
useVideoFramefrom@/hooks/use-video-frameextracts first, last, or timestamped frames from videos.useVideoStitchfrom@/hooks/use-video-stitchconcatenates multiple clips into one downloadable file.useVideoAudioOverlayfrom@/hooks/use-video-audio-overlayreplaces or mixes audio onto a video.
Those helpers are folded into the AI Video reference because they are most often used to continue, assemble, or narrate generated videos.
Platform Features
Feature reference pages cover browser and platform capabilities that apps commonly combine with AI.
- File Upload:
useFileUpload, supported MIME types, upload results, persistence, and error handling. - File Download:
useDownload, supported data types, file naming, media type detection, and ZIP exports with JSZip. - Web Extraction:
useWebExtract, extracted markdown output, and AI summarization patterns. - Push Notifications:
useNotification, one-time and recurring scheduling, cancellation, status checks, and failure UX.
These APIs are designed to compose. For example, upload a file, pass the returned URL to an AI hook as an attachment, then download the generated result with useDownload.
Routing and UI
Routing and UI references document app structure, Tailwind-first interface patterns, and supported rendering libraries.
- React Router: Route setup and navigation patterns.
- Radix Primitives: Headless primitives for complex interactions.
- Vaul Drawer: Drawers and bottom sheets with drag gestures.
- Charts: Chart rendering patterns.
- Mermaid: Diagram rendering.
- KaTeX: Math rendering.
Supported Libraries
Library references document packages that are available for common app tasks.
- date-fns: Date formatting and manipulation.
- dnd-kit: Drag-and-drop interactions.
- Embla Carousel: Carousels and sliders.
- html-to-image: DOM-to-image capture.
- lucide-react: Icon components.
- Motion: Animation primitives.
- p5: Creative coding canvas.
- Papa Parse: CSV parsing.
- React Hook Form: Form state.
- React PDF: PDF rendering.
- uuid: Unique IDs.
- xlsx: Spreadsheet parsing and generation.
- Zod: Runtime validation.
Reference Patterns
Reference docs are intentionally more technical than product guides. They should answer:
- Which module to import from.
- Which hook or helper to call.
- Which parameters are required.
- What each return value means.
- What errors look like and how to recover.
- Which data should be persisted.
- Which examples show the smallest complete pattern.
When building apps, prefer the platform hooks over custom API calls. The hooks handle loading state, validation, uploads, error toasts, and subscription-aware model behavior consistently across apps.