Bundle Size & Tree-Shaking
Import from the most specific module to minimize bundle size:| Module | Added size (approx.) |
|---|---|
@flowdrop/flowdrop/core | ~15KB (types & utils only) |
@flowdrop/flowdrop/form | ~40KB |
@flowdrop/flowdrop/editor | ~200KB (includes @xyflow/svelte) |
@flowdrop/flowdrop/form/code | ~300KB (CodeMirror) |
@flowdrop/flowdrop/playground | ~250KB (editor + chat) |
@flowdrop/flowdrop (full) | ~500KB+ |
form/code and form/markdown if you actually need code/template editing.
CSS Import
Always import FlowDrop styles. Without this, the editor renders blank:Svelte / SvelteKit
FlowDrop is a Svelte 5 library, so it integrates natively:React / Vue / Angular / Vanilla JS
Use the Mount API to embed FlowDrop in any container:React Example
Docker
Package your frontend and backend together:Static Hosting
If your frontend is a static SPA (Vite, SvelteKit adapter-static, etc.):- Build your app:
npm run build - Deploy the
dist/folder to any static host (Vercel, Netlify, S3, etc.) - Configure CORS on your backend to allow the static host’s origin
Environment Variables
Common configuration to externalize:| Variable | Purpose | Example |
|---|---|---|
VITE_API_URL | Backend API base URL | /api/flowdrop |
VITE_AUTH_TOKEN | Static auth token (dev) | dev-token-123 |
Next Steps
- Framework Integration — framework-specific setup
- Authentication Patterns — secure your deployment
- Backend Implementation — build your API