# Changelog
Source: https://docs.kleap.co/changelog/index
Latest updates and improvements to Kleap
Stay up to date with the latest features, improvements, and fixes.
Subscribe to our newsletter or follow us on Twitter for update notifications.
***
## July 2026
### Platform on Astro + Kleap Database
**Faster sites, built-in database** ⚡
* Kleap now builds **Astro** websites (Tailwind CSS v4, React islands) — static-first for speed and SEO
* Sites can be published to `your-app.kleap.io` on a global edge network, with free SSL
* **Kleap Database** — an optional built-in database with user accounts — add it on demand for saved data and logins
* **Custom domains** connect via a simple A record with automatic SSL
* Built-in **Forms** collect submissions to your dashboard with email notifications
***
## January 2025
### January 13, 2025
**Documentation Launch** 🎉
* Launched comprehensive documentation at docs.kleap.co
* 55+ pages covering all features
* Tutorials for common use cases
* Integrated search
***
### January 2025 (Earlier)
**Preview Improvements**
* Faster live previews
* Reduced sandbox startup time to under 2 seconds
* Improved hot reload reliability
**Template Updates**
* Refreshed the starter template and components
* Added new minimal template for quick starts
* Improved mobile responsiveness in all templates
**AI Improvements**
* Better code generation accuracy
* Improved understanding of complex prompts
* Faster response times
***
## December 2024
**Single-Email Transfer Flow**
* Simplified app transfer process
* Transfer apps with just an email address
* Improved transfer confirmation UX
**Template Gallery**
* New template browser in app creation
* Preview templates before selecting
* Category filters for easier discovery
**Bug Fixes**
* Fixed file sync issues in certain edge cases
* Improved error messages for failed deployments
* Fixed authentication state persistence
***
## November 2024
**Faster Previews**
* Improved the live preview infrastructure
* 10x faster sandbox creation
* More reliable file synchronization
* Configurable auto-stop (15 minutes default)
**Version History Improvements**
* Faster history loading
* Better diff visualization
* Improved restore functionality
***
## Earlier Updates
### Q3 2024
* Initial public beta launch
* Core AI chat functionality
* Built-in database integration
* One-click deployment
* Element selection
* Basic templates
### Q2 2024
* Private alpha testing
* Core architecture development
* Integration groundwork
***
## Upcoming
We're working on:
* More templates
* Enhanced collaboration features
* Additional integrations
* Performance improvements
* Mobile app support
Have a feature request? Share it on Discord or email [hello@kleap.co](mailto:hello@kleap.co)
***
## Version Numbers
Kleap uses continuous deployment, so we don't have traditional version numbers. Updates are deployed as they're ready, and this changelog reflects significant changes.
## Breaking Changes
We strive to avoid breaking changes. When necessary, they are:
* Announced in advance
* Documented with migration guides
* Rolled out gradually
***
## Stay Updated
Follow for announcements
Join the community
# AI Chat
Source: https://docs.kleap.co/features/ai-chat
Build applications through natural conversation
The AI Chat is your main interface for building apps with Kleap. Simply describe what you want, and the AI generates the code.
## How It Works
1. **Describe your request** in the chat input
2. **AI processes** your request and generates code
3. **Preview updates** in real-time
4. **Iterate** by sending follow-up messages
## Writing Effective Prompts
### Be Specific
```
Create a contact form with fields for name, email,
and message. Add a submit button that shows a
success toast when clicked.
```
```
Add a form
```
### Include Context
Tell the AI where and how:
```
Add a testimonials section to the homepage, below
the features section. Use a carousel with 3 cards
showing customer photos, names, and quotes.
```
### Reference Existing Elements
```
Change the header background to match the footer color
```
```
Make the pricing cards look like the feature cards above
```
## Example Prompts
### Creating Components
```
Create a pricing table with 3 tiers: Free, Pro, and
Enterprise. Include feature lists and CTA buttons.
```
### Styling Changes
```
Make the hero section full-height with a gradient
background from purple to blue
```
### Adding Functionality
```
Add user authentication with email/password login
and a sign-up form
```
### Fixing Issues
```
The button on mobile is too small. Increase the
padding and font size on screens below 768px
```
## Chat Features
### Message History
Your conversation is saved automatically. Scroll up to see previous messages and the AI's responses.
### Regenerate Response
If you're not happy with a response, you can ask the AI to try again:
```
That's not quite right. Can you try a different approach?
```
### Credit Usage
Each message consumes credits based on complexity:
| Request Type | Typical Cost |
| -------------------------- | -------------- |
| Small text or style change | Under 1 credit |
| New section or component | 1–3 credits |
| Full page creation | 3–8 credits |
| Large, complex feature | 8+ credits |
*Estimates — actual usage depends on the request. Image generation and text editing are free.*
You can see your remaining credits in the top navigation bar.
## Tips for Better Results
Instead of asking for an entire app at once, build incrementally:
1. "Create the homepage layout"
2. "Add a navigation header"
3. "Create the hero section"
4. "Add the features grid"
Mention styles you like:
* "Use a clean, minimal design like Linear"
* "Make it colorful and playful like Notion"
* "Professional and corporate like Stripe"
Share references:
* "Similar to how Airbnb shows listings"
* "Like a Trello board layout"
Make one change at a time for precise control:
* "Increase the heading size"
* "Add more spacing between sections"
* "Change the button color to green"
## Common Issues
If the AI seems stuck or gives unexpected results:
1. Be more specific in your request
2. Break it into smaller steps
3. Reference specific files or components
4. Refresh and try again
Master the art of prompting for better results
# Analytics
Source: https://docs.kleap.co/features/analytics
Track your app's performance and visitor metrics
Understand how users interact with your app using built-in analytics.
## Kleap Analytics
Published apps include analytics tracking:
* **Page views** - Track which pages are visited
* **Unique visitors** - Count individual users
* **Referrers** - See where traffic comes from
* **Geography** - Visitor locations
* **Devices** - Desktop, mobile, tablet breakdown
## Enabling Analytics
Analytics are automatically enabled when you publish your app.
### Viewing Analytics
1. Go to **Settings** > **Analytics**
2. View metrics directly in your Kleap dashboard
### Dashboard Metrics
| Metric | Description |
| ----------------- | ---------------------------- |
| **Visitors** | Unique users in time period |
| **Page Views** | Total page loads |
| **Bounce Rate** | Single-page visit percentage |
| **Avg. Duration** | Time spent on site |
| **Top Pages** | Most visited pages |
| **Top Referrers** | Traffic sources |
## Web Vitals
Track Core Web Vitals for performance:
* **LCP** (Largest Contentful Paint) - Loading performance
* **FID** (First Input Delay) - Interactivity
* **CLS** (Cumulative Layout Shift) - Visual stability
Good Web Vitals improve SEO rankings and user experience.
## Real-Time Data
See visitors on your site right now:
* Current active users
* Pages being viewed
* Geographic distribution
## Time Periods
View analytics for different periods:
* Last 24 hours
* Last 7 days
* Last 30 days
* Custom date range
## Traffic Sources
Understand where your visitors come from:
| Source | Examples |
| ------------ | ----------------------------- |
| **Direct** | Typed URL, bookmarks |
| **Search** | Google, Bing, DuckDuckGo |
| **Social** | Twitter, LinkedIn, Facebook |
| **Referral** | Other websites linking to you |
## Geographic Data
See visitor locations:
* Country breakdown
* City-level data (Pro plan)
* Map visualization
## Device Analytics
Understand your audience's devices:
* **Desktop** vs **Mobile** vs **Tablet**
* **Browser** breakdown (Chrome, Safari, Firefox)
* **Operating System** (Windows, macOS, iOS, Android)
## Privacy Compliance
Kleap Analytics is privacy-friendly:
* No cookies required
* GDPR compliant
* No personal data collected
* Anonymized visitor data
Unlike Google Analytics, Kleap Analytics doesn't require cookie consent banners.
## Third-Party Analytics
You can also add other analytics tools:
### Google Analytics
Open **Settings > Project settings > Integrations**, choose **Google Analytics**, and click **Connect**. You can also ask the AI to add it:
```
Add Google Analytics with tracking ID G-XXXXXXXXXX
```
### Other Options
* **Plausible** - Privacy-focused
* **Fathom** - Simple, fast
* **Mixpanel** - Product analytics
* **PostHog** - Open-source analytics
## Analytics Plans
| Feature | Free | Pro | Enterprise |
| -------------- | -------- | ------- | ---------- |
| Page views | 10K/mo | 100K/mo | Unlimited |
| Data retention | 24 hours | 30 days | 1 year |
| Real-time | ✓ | ✓ | ✓ |
| Web Vitals | ✓ | ✓ | ✓ |
| Export | - | ✓ | ✓ |
## Best Practices
Review weekly to understand trends and identify issues.
Keep LCP \< 2.5s, FID \< 100ms, CLS \< 0.1 for good scores.
Focus on conversion pages (pricing, signup, checkout).
Compare week-over-week to spot growth or problems.
Use analytics insights to optimize for search engines
# Code Editor
Source: https://docs.kleap.co/features/code-editor
View and edit your app's source code
While AI handles most code generation, you can view and understand the source code of your app at any time.
## Accessing the Code
### Open the code view
1. Click **Settings** in the top toolbar
2. Choose **View code**
3. Select a file from the file browser
The code view shows:
* All project files
* Folder structure
* File types (astro, tsx, css, etc.)
### Viewing Files
Click any file to view its contents:
* Syntax highlighting
* Line numbers
* Code formatting
## File Structure
A typical Kleap app follows Astro conventions:
```
├── src/
│ ├── pages/ # Pages and routes (.astro)
│ │ └── index.astro # Homepage
│ ├── layouts/ # Shared layouts
│ │ └── Base.astro # Root layout (header, footer)
│ ├── components/ # Reusable components (.astro + .tsx islands)
│ └── styles/
│ └── global.css # Global styles (Tailwind v4)
├── public/ # Static assets
├── astro.config.mjs # Astro config (managed by Kleap)
└── package.json # Dependencies
```
## Understanding the Code
### Technologies Used
| Technology | Purpose |
| -------------------- | ----------------------------------- |
| **Astro 5** | Static-first web framework, routing |
| **Tailwind CSS v4** | Utility-first styling |
| **React 19 islands** | Interactive components |
| **TypeScript** | Type-safe JavaScript |
### Key Files
* `src/pages/index.astro` - Your homepage
* `src/layouts/Base.astro` - Root layout (header, footer)
* `src/components/` - Your custom components
* `src/styles/global.css` - Global styling
## Editing Code
Direct code editing is for advanced users. For most changes, use the AI chat instead.
### When to Edit Directly
* Fixing typos in text
* Minor CSS adjustments
* Understanding how something works
* Debugging issues
### How to Edit
1. Open the file in the editor
2. Make your changes
3. Save (Ctrl/Cmd + S)
4. Preview updates automatically
## Working with AI
The AI can reference specific files:
```
Look at src/pages/index.astro and move the hero section
above the features section
```
```
In src/components/Header.astro, change the logo size
```
```
Update the color scheme in src/styles/global.css
```
## Exporting Code
### Push to GitHub
1. Go to **Settings** > **Project settings** > **Integrations**
2. Choose **GitHub** and click **Connect**
3. Connect your GitHub account
4. Create or connect a repository
5. Push your code
### Download Files
1. Go to **Settings** > **Export**
2. Click **Download ZIP**
3. Get all source files locally
## Best Practices
For anything beyond simple text edits, describe what you want in chat. AI understands the full context.
If you break something, use [version history](/features/version-history) to roll back.
Review AI-generated code to learn Astro and React patterns.
## Code Quality
AI-generated code follows best practices:
* TypeScript for type safety
* Component-based architecture
* Responsive design patterns
* Accessibility standards
* Performance optimization
Push your code to version control
# Collaboration
Source: https://docs.kleap.co/features/collaboration
Work together with your team on apps
Build apps together with team members using Kleap's collaboration features.
## Team Features
* **Shared apps** - Multiple people can work on the same app
* **Role management** - Control who can do what
* **App transfer** - Move apps between accounts
* **Team billing** - Centralized credit management
## Inviting Team Members
### Add to an App
1. Open your app
2. Go to **Settings** > **Project settings** > **People**
3. Click **Invite Member**
4. Enter their email address
5. Select their role
6. Send invitation
### Invitation Flow
1. Team member receives email
2. They click the invite link
3. Sign up or log in to Kleap
4. Access is granted automatically
Team members need their own Kleap account to collaborate.
## Roles & Permissions
| Role | View | Edit | Deploy | Settings | Billing |
| ---------- | ---- | ---- | ------ | -------- | ------- |
| **Viewer** | ✓ | - | - | - | - |
| **Editor** | ✓ | ✓ | ✓ | - | - |
| **Owner** | ✓ | ✓ | ✓ | ✓ | ✓ |
### Role Details
Can view the app, code, and preview. Cannot make changes.
Can edit the app using AI chat and code editor, and deploy to production. Cannot change app settings.
Complete control including billing, settings, deletion, and transfer.
## Managing Team Members
### Change Role
1. Go to **Settings** > **Project settings** > **People**
2. Find the team member
3. Click their role dropdown
4. Select new role
### Remove Member
1. Go to **Settings** > **Project settings** > **People**
2. Find the team member
3. Click **Remove**
4. Confirm removal
Removed members lose access immediately but their previous edits remain.
## App Transfer
Transfer app ownership to another user.
### Transfer to Team Member
1. Go to **Settings** > **Transfer**
2. Select the recipient (must be a team member)
3. Confirm transfer
4. Recipient accepts the transfer
### Transfer to Any User
1. Go to **Settings** > **Transfer**
2. Enter recipient's email
3. They receive a transfer request
4. They accept and become the new owner
After transfer, you no longer have access to the app. The new owner can invite you back if needed.
## Working Together
### Best Practices
Let team members know when you're making big changes.
Check history to see what others have changed.
Give appropriate permissions for each person's job.
Have someone review changes before publishing.
### Avoiding Conflicts
Currently, Kleap doesn't have real-time collaboration (like Google Docs). To avoid conflicts:
1. **Communicate** when you're working on the app
2. **Work on different parts** at the same time
3. **Refresh** before starting to get latest changes
4. **Use version history** to recover if needed
## Team Billing
### Credit Usage
* Each edit uses credits from the **app owner's** account
* Team members don't need their own credits to edit
* Owner can view credit usage per team member
### Pro Team Features
On Pro and Enterprise plans:
* More team members allowed
* Priority support for all members
## Limits
| Plan | Team Members per App |
| ---------- | -------------------- |
| Free | 2 |
| Pro | 10 |
| Enterprise | Unlimited |
## Enterprise Features
For larger teams, contact us about:
* **SSO** - Single sign-on integration
* **Audit logs** - Track all team activity
* **Custom roles** - Define your own permissions
* **Organization** - Manage multiple teams
[Contact us](mailto:hello@kleap.co) about Enterprise plans.
# Custom Domains
Source: https://docs.kleap.co/features/custom-domains
Connect your own domain to your published app
Give your app a professional identity by connecting your own domain.
Custom domains are available on **Pro plans and above**. [Upgrade to Pro](/features/overview) to unlock this feature.
## Domain Options
### Kleap Subdomain (Free)
Every published app gets a free URL:
```
https://your-app-name.kleap.io
```
### Custom Domain (Pro)
Connect your own domain:
```
https://myapp.com
https://app.mycompany.com
```
## Setting Up a Custom Domain
### Step 1: Get a Domain
You can purchase a domain directly in Kleap (**Settings > Domains**), or use one you already own from:
* [Namecheap](https://namecheap.com)
* [Cloudflare](https://cloudflare.com)
* [GoDaddy](https://godaddy.com)
### Step 2: Add Domain in Kleap
1. Click **Settings** in the builder toolbar
2. Open **Project settings**
3. Choose **Domains** under **Distribution**
4. Choose **Buy New**, **Transfer**, or **Connect Existing**
5. Enter your domain (e.g., `myapp.com`)
6. Copy the DNS records shown
### Step 3: Configure DNS
Add an **A record** at your domain registrar pointing to Kleap's server:
| Type | Name | Value |
| ---- | ---- | ------------- |
| A | @ | 178.104.71.55 |
| A | www | 178.104.71.55 |
| Type | Name | Value |
| ---- | ---- | ------------- |
| A | app | 178.104.71.55 |
Kleap only supports **A records**. Do not use CNAME records for your root domain.
**Using Cloudflare?** Set the proxy status to **DNS only** (grey cloud icon, not orange). The Cloudflare proxy blocks SSL certificate generation via Let's Encrypt. See the [Cloudflare section](#domain-with-cloudflare) below for details.
### Step 4: Verify
1. Return to Kleap settings
2. Kleap automatically checks your DNS every 10 seconds
3. Once detected, your SSL certificate is provisioned automatically
DNS changes typically take a few minutes to 48 hours to propagate worldwide.
## SSL Certificates
Kleap automatically provisions and renews SSL certificates via Let's Encrypt:
* **Free SSL** - Included with all custom domains
* **Auto-renewal** - Certificates renew automatically
* **HTTPS enforced** - HTTP redirects to HTTPS
## Multiple Domains
You can connect multiple domains to one app:
* `myapp.com` (primary)
* `www.myapp.com` (alias)
* `app.mycompany.com` (alias)
## Troubleshooting
* Double-check the A record points to `178.104.71.55`
* Wait up to 48 hours for propagation
* Use [DNS Checker](https://dnschecker.org) to verify
* Ensure no conflicting A or CNAME records exist for the same name
* DNS must resolve to `178.104.71.55` first
* If using Cloudflare, make sure proxy is **OFF** (grey cloud / DNS only)
* Wait 10-15 minutes after DNS propagation
Add an A record for `www` pointing to `178.104.71.55`, same as the root domain.
* If using Cloudflare, disable the proxy (set to DNS only / grey cloud)
* Make sure you don't have conflicting CNAME and A records
## Domain with Cloudflare
If using Cloudflare as your DNS provider:
1. Add an **A record** pointing to `178.104.71.55`
2. Set proxy status to **DNS only** (grey cloud icon)
3. Wait for the SSL certificate to be issued (usually under 10 minutes)
**Do not enable the Cloudflare proxy (orange cloud)** when first setting up your domain. The proxy blocks SSL certificate generation via Let's Encrypt. You can re-enable it after your site is live, but DNS only mode is recommended.
## Removing a Domain
1. Go to **Settings** > **Domains**
2. Click the trash icon next to the domain
3. Confirm removal
4. Update or remove DNS records at your registrar
## Best Practices
Keep `mycompany.com` for your main site, use `app.mycompany.com` for the Kleap app.
Add an A record for both `@` and `www` to cover both variants.
Set reminders for domain renewal to avoid losing your URL.
Keep the grey cloud (DNS only) for reliable SSL certificate provisioning.
You need a published app before adding a custom domain.
# Element Selection
Source: https://docs.kleap.co/features/element-selection
Click on any element to select and edit it
Element selection lets you click on any part of your app to select it, then make changes through the AI chat.
## How It Works
1. Click **Edit** in the builder toolbar
2. **Click** on any element in the preview
3. The element gets **highlighted** with a blue border
4. The AI knows **what you selected**
5. **Ask for changes** - "Make this bigger", "Change the color"
## Selecting Elements
### Single Element
Click directly on the element you want to modify:
* Text blocks
* Buttons
* Images
* Containers
* Forms
* Navigation items
### Visual Feedback
When selected:
* **Blue border** shows the selected element
* **Element info** appears (tag, class)
* The AI references this element in responses
## Making Changes
Once selected, describe your change:
### Styling
```
Make this text larger
```
```
Change the background color to blue
```
```
Add more padding around this section
```
### Content
```
Change this heading to "Welcome to My App"
```
```
Replace this image with a placeholder
```
### Layout
```
Center this content
```
```
Make this a 3-column grid
```
### Functionality
```
Make this button open a modal
```
```
Add a click animation to this card
```
## Examples
1. Click the button in preview
2. Type: "Make this button green with white text"
3. AI updates the button styling
1. Click anywhere in a section
2. Type: "Add a gradient background to this section"
3. AI applies the gradient
1. Click on a card component
2. Type: "Add a shadow and round the corners more"
3. AI updates the card styles
## Tips for Better Selection
Click directly on the element you want. If you hit a parent container, try clicking closer to the content.
If clicking doesn't select the right element:
```
The third button in the navigation bar
```
```
The hero section heading
```
You can describe multiple elements:
```
Make all buttons in this section rounded
```
```
Change the color of all headings to blue
```
## Limitations
* Some deeply nested elements may be harder to select
* Dynamic elements (modals, dropdowns) need to be visible to select
* For complex selections, describe the element in chat
## Without Selection
You can still make changes without selection by being descriptive:
```
Change the main heading on the homepage to "Welcome"
```
```
Update the footer background to dark gray
```
```
Make all buttons have rounded corners
```
Get better at describing changes
# Forms & Data Management
Source: https://docs.kleap.co/features/forms-data
Collect and manage form submissions with built-in data storage and notifications
All form submissions are automatically saved to your Kleap dashboard. No configuration needed - forms work out of the box!
## How Forms Work
Kleap forms automatically:
* **Save submissions** - Every submission stored in your dashboard
* **Track metadata** - IP address, timestamp, user agent
* **Support multiple forms** - Each form has a unique ID
* **Export data** - Download as CSV anytime
Forms work in both the editor preview and on your published site. All data is automatically backed up.
## Viewing Form Submissions
Access all form submissions from your dashboard:
1. Open your project
2. Click **Settings** in the builder toolbar
3. Choose **Project settings**
4. Open **Data Management** under **Data**
5. Browse submissions with dates and user information
### Dashboard Tabs
| Tab | Description |
| ---------------- | ---------------------------------------------- |
| **Summary** | Visual analytics and statistics for each field |
| **Submissions** | Complete list of all responses |
| **Integrations** | Configure email notifications and webhooks |
## Email Notifications
Get notified when someone submits your form:
1. Open your project
2. Open **Settings** > **Project settings** > **Data Management**
3. Open the form's integrations
4. Check "Get email notifications"
5. Enter your email address
6. Click "Save Integration Settings"
You can add multiple email addresses separated by commas to notify your whole team!
### Notification Features
* **Instant alerts** - Receive emails within seconds
* **Full submission data** - All form fields included
* **Multiple recipients** - Add unlimited email addresses
* **Free on all plans** - No Pro plan required
## Form Integrations
### Email Notifications (Free)
Send notifications to yourself or your team:
```
✓ Instant email alerts
✓ Multiple email addresses
✓ All form data included
✓ No setup required
```
### Respondent Notifications (Pro)
Automatically thank form submitters:
* Custom email subject
* Custom email body
* Sent to form respondent's email
* Professional auto-responder
Unlock respondent notifications and advanced features
### Webhooks (Pro)
Send form data to your own API:
* Real-time HTTP POST requests
* Custom endpoint URL
* Full submission payload
* Test webhook functionality
* View delivery logs
## Exporting Data
Download all form submissions as CSV:
1. Go to the **Data** tab
2. Click **Export CSV** (top right)
3. Open in Excel, Google Sheets, or any spreadsheet software
### Export Features
* All form fields included
* Timestamps and metadata
* Filter by form or date range
* Compatible with all spreadsheet apps
## Multiple Forms
Manage multiple forms on one site:
* Each form has a unique `formId`
* Submissions grouped by form
* Separate analytics per form
* Individual export for each form
### Form List View
When you have multiple forms:
* Dashboard shows all forms
* Click a form to view its submissions
* See submission count per form
* Track form performance
## Text Editing
Edit text on your site without using credits:
1. Click **Edit** in the builder toolbar
2. Click any text block in the preview
3. Edit directly in the text editor
4. Click outside to save
5. Changes apply immediately
Text editing is free and doesn't consume AI credits!
## Form Setup (Technical)
Forms use the `KleapForm` component:
```tsx theme={null}
```
### Supported Field Types
| Type | Description | Example |
| ---------- | ---------------- | ----------------- |
| `text` | Single-line text | Name, company |
| `email` | Email validation | Email address |
| `tel` | Phone number | Contact number |
| `textarea` | Multi-line text | Message, feedback |
| `select` | Dropdown menu | Country, category |
| `checkbox` | Yes/no option | Newsletter signup |
| `radio` | Single choice | Size, preference |
| `url` | URL validation | Website |
| `number` | Numeric input | Age, quantity |
## Troubleshooting
Forms work automatically. Check these:
* Go to Data tab in your dashboard
* Verify you're in the correct project
* Email notifications need to be enabled separately
* All submissions ARE saved even without emails
Check these settings:
* Data tab → Integrations → "Get email notifications" must be checked
* Email address must be entered correctly
* Check your spam folder
* Test with a form submission
1. Data tab → Integrations tab
2. Update the email address field
3. Click "Save Integration Settings"
4. Changes apply immediately
Yes! Each submission has a delete button in the Submissions tab.
Unlimited! Create as many forms as you need. Each form is tracked separately.
## Privacy & Security
Form submissions are secure:
* **SSL encryption** - All data transmitted securely
* **Data privacy** - Only you can access submissions
* **GDPR compliant** - User data handled responsibly
* **No third-party sharing** - Your data stays with Kleap
## Common Use Cases
### Contact Forms
Collect inquiries from visitors:
```tsx theme={null}
```
### Newsletter Signup
Build your email list:
```tsx theme={null}
```
### Lead Generation
Qualify potential customers:
```tsx theme={null}
```
## Best Practices
Ask only essential questions. Every field reduces completion rate by \~10%.
Respond to inquiries quickly by enabling instant email alerts.
Backup form submissions weekly to avoid data loss.
Submit a test entry to verify email notifications work correctly.
Make it obvious what information you're requesting.
Confirm submission with a friendly thank you message.
## FAQs
**Q: Do forms work on published sites?**
A: Yes! Forms work identically in the editor preview and on your published site.
**Q: Can I connect forms to my own database?**
A: Use webhooks (Pro plan) to send form data to your API in real-time.
**Q: How many submissions can I receive?**
A: Unlimited! All plans support unlimited form submissions.
**Q: Can I have multiple forms on one site?**
A: Yes! Each form has a unique `formId` and submissions are grouped by form.
**Q: Can I customize form styling?**
A: Yes! Forms use Tailwind CSS with React islands. Ask the AI to customize appearance.
**Q: Is there a size limit for submissions?**
A: Text fields support up to 10,000 characters. File uploads not currently supported.
Contact our support team for assistance with forms
# Live Preview
Source: https://docs.kleap.co/features/live-preview
See your app in real-time as you build
The live preview shows your site as it's being built. Every change appears instantly, right inside the Kleap editor.
## How It Works
Kleap builds your site with a real, ephemeral build and renders it live inside the editor. What you see in the preview is exactly what your visitors get once you publish.
* **Updates instantly** when the AI edits your code or you make a change
* **Reflects the real build** — the same output as production, not a mockup
* **Fully interactive** — click, type, and navigate like a live site
Your site is built with **Astro 5** (static HTML), **Tailwind CSS v4**, and **React 19 islands** for interactivity — so the preview is fast and matches the published result.
## Preview Panel
The preview panel on the right side of the editor shows:
* Your rendered site
* Real-time updates as the AI (or you) edit code
* Interactive elements (click, type, navigate)
### Controls
| Control | Action |
| ------------------- | ------------------------------------ |
| **Refresh** | Reload the preview |
| **Open in new tab** | View in full browser window |
| **Device toggle** | Switch between desktop/tablet/mobile |
| **URL bar** | Navigate to different pages |
## Keeping the Preview Fresh
The preview rebuilds automatically whenever your site changes. If it ever looks out of date:
1. **Send a new message** — any chat interaction rebuilds and refreshes it
2. **Click Refresh** — in the preview panel
3. **Reopen the app** — from your apps list
## Preview vs. Published Site
The preview lives inside the editor and is only visible to you while you work. To get a permanent, public, shareable URL, [publish your app](/features/publishing).
Publishing is a **deliberate action**. Click **Publish** when the preview is ready, then use **Update** whenever you want later changes to go live. An eligible published site lives at:
```
https://your-app.kleap.io
```
Publishing does not use AI credits. Publishing availability, hosting, and published-project limits depend on your plan. Sites are served on a global edge network with automatic HTTPS. For custom domains, see [custom domains](/features/custom-domains).
## Testing Your App
### Interactive Testing
In the preview, you can:
* Click buttons and links
* Fill out forms
* Navigate between pages
* Test responsive layouts
### Mobile Testing
Click the device toggle to switch between:
* **Desktop** (1280px+)
* **Tablet** (768px)
* **Mobile** (375px)
### Console Access
Open browser DevTools to see:
* Console logs
* Network requests
* JavaScript errors
## Common Issues
1. Check if you have a stable internet connection
2. Try refreshing the preview
3. Send a new message to rebuild the preview
4. Clear browser cache and reload
1. Wait a few seconds for the rebuild to finish
2. Try refreshing the preview
3. Check for errors in the chat
Large sites or complex operations may take longer. Consider:
* Breaking changes into smaller steps
* Optimizing images and assets
* Removing unused code
## Preview vs Production
| Aspect | Preview | Production |
| ---------- | ----------------------- | --------------------------------------------------------- |
| Where | Inside the editor | Public URL (`your-app.kleap.io`) |
| Visibility | Only you, while editing | Public until unpublished, subject to the Terms of Service |
| Purpose | Build and test | Live for visitors |
| Output | Real build | Same build, on a global edge network |
Publish your app to production
# Features Overview
Source: https://docs.kleap.co/features/overview
Explore everything you can do with Kleap
Kleap lets you create apps, internal tools, websites, logos, animations, and other digital projects. Web projects can be previewed, published, and managed from the same product.
## Core Features
Build through conversation. Describe what you want and watch it come to life.
See your changes instantly in a real, built preview.
Click any element to select and edit it visually.
View and edit the generated source code directly when needed.
## Development Tools
Track changes and roll back to any previous version.
Collect submissions in your dashboard, with email notifications.
## Deployment & Hosting
Publish a reviewed web project to an eligible live `kleap.io` URL.
Connect your own domain with automatic SSL.
Track visitors and pageviews.
## Collaboration & Security
Invite team members and build together.
Built-in security checks and best practices.
## Feature Highlights
| Feature | Description |
| ------------------------- | ------------------------------------------------ |
| **Real-time preview** | See changes as you build |
| **AI-powered building** | Describe features, Kleap builds them |
| **Deliberate publishing** | Choose when a reviewed version goes live |
| **Global edge hosting** | Fast delivery on a global edge network, free SSL |
| **Built-in forms** | Submissions and notifications, no setup |
| **Optional database** | Add Kleap Database and user accounts |
| **GitHub sync** | Version control and code ownership |
| **Custom domains** | Your brand, your URL |
| **Version history** | Never lose your work |
# Publishing
Source: https://docs.kleap.co/features/publishing
Deploy a web project to its production URL
Kleap hosts published web projects for you — one click gives you a production URL with no build step to manage.
## Publishing is a deliberate action
Your site is **not public until you publish it**. Building and refining in the editor changes nothing for visitors — that way an unfinished site never goes live under your name.
When you're ready, click **Publish** (top-right in the builder). Kleap builds your site and deploys it to a permanent URL.
Later changes are **not** pushed live automatically. Each time you want the public site to catch up with your edits, click **Update** — the same button.
Publishing does not consume AI credits. Publishing availability, hosting, and published-project limits depend on your plan; see [current pricing](https://kleap.co/pricing).
## Your Production URL
Once published, your site is live at a permanent URL:
```
https://your-app-name.kleap.io
```
This URL:
* Remains available until you unpublish it, subject to the [Terms of Service](https://kleap.co/tos)
* Is **publicly accessible**
* Supports **HTTPS** automatically
* Is served on a **global edge network** for fast loading worldwide
* Can be **shared** with anyone
## Preview vs Production
| Aspect | Preview | Production |
| ------------ | -------------------- | ------------------- |
| Where | In the Kleap editor | `your-app.kleap.io` |
| Intended use | Building session | Live visitors |
| Access | You (and your team) | Public |
| Purpose | Building and testing | Live visitors |
The preview is a real build of your current files, so what you see is what visitors get.
## Updating Your Site
After the initial publish:
1. Make changes in Kleap (or ask the AI)
2. Review the updated preview
3. Click **Update** when you want the new version to go live
Each publish creates a new version. Use [Version History](/features/version-history) to roll back anytime.
## Deployment Status
Track your deployment:
* **Building** — your site is compiling
* **Deploying** — uploading to the edge
* **Ready** — live and accessible
* **Error** — build failed (see the error and re-try)
If a deployment fails, the error is shown in the chat. Ask the AI to fix it, then publish again when the preview is ready.
## Custom Domains & Going Further
Connect your own domain with free SSL
Track your site's visitors
## Unpublishing
To take your site offline:
1. Go to **Settings**
2. Choose **Unpublish**
3. Your site is no longer publicly accessible
Unpublishing doesn't delete your site — you can republish anytime.
# Security
Source: https://docs.kleap.co/features/security
Keep your app and data safe
Kleap builds fast **static Astro sites**, and a lot of security is handled for you. Because your published site is static, there's no server code or secret keys living inside it for attackers to reach. This page explains what's protected automatically and the few things you should still keep in mind.
## Safe by default
Every Kleap site ships with these protections built in:
* **HTTPS everywhere** - SSL is automatic on your `{app}.kleap.io` address and on any custom domain you connect. Nothing to configure.
* **No server secrets in the site** - Your published site is static HTML/CSS/JS. Kleap never bundles secret keys or credentials into it.
* **Server-validated forms** - Form submissions are validated, sanitized, and rate-limited by Kleap before they reach you. No setup required.
* **Secure headers** - XSS protection, HSTS, and other hardening headers are applied for you.
* **Pre-build checks** - Before publishing, Kleap scans for accidentally exposed secrets and unsafe patterns.
## Pre-Build Security Checks
Before your site goes live, Kleap automatically scans for:
* **Exposed secrets** - Secret API keys or passwords accidentally placed in the site
* **Hardcoded credentials** - Tokens or private keys that don't belong in a public site
* **Unsafe patterns** - Risky code such as injecting unescaped user content (XSS risks)
Never paste secret keys, passwords, or private tokens into your prompts or anywhere in your site. Anything in a published static site is public. See "Keep secrets out of your site" below.
## Keep secrets out of your site
Your published site is static, which means **anything inside it can be viewed by anyone**. That's fine for the code that runs your pages, but it means secrets must never live there.
* **Publishable keys are OK.** Keys that are designed to be public — like a Stripe **publishable** key (`pk_live_...` / `pk_test_...`) — are safe to include in a site.
* **Secret keys are never OK.** A secret key (`sk_live_...`), database password, or private API token must **never** appear in your site or in a prompt.
```txt theme={null}
✅ Safe in a site: Stripe publishable key pk_live_...
❌ Never in a site: Stripe secret key sk_live_...
❌ Never in a site: passwords, private tokens, database credentials
```
If a feature you want needs a secret to work, it belongs on a server — not in a static site. Kleap's built-in **Database** and **Forms** (below) already handle the common cases server-side for you.
## User accounts & dynamic data
Need logins, saved data, or content that changes per user? Turn on the **Kleap Database** — a managed database with built-in user accounts. It's optional and available on demand; just ask the AI to add it when your app needs it. You don't connect or manage any outside database yourself.
### Built-in accounts
Kleap Database includes **email + password user accounts** with the sign-up and log-in UI provided for you. Passwords are hashed and sessions are managed securely — you don't have to build any of it.
### Each user sees only their own data
Data access is scoped per user, so each signed-in user can only see and change **their own rows**. This is the primary defense for your data: even though many users share one database, Kleap keeps everyone's data separated at the database level.
Kleap ensures a user only ever reads or writes rows that belong to them. When you add data features through Kleap, ask the AI to make sure each table is scoped to the current user so no one can read someone else's records.
```
Make sure my [posts] table is protected so each user
can only see and edit their own rows.
```
For pages that should only be visible to signed-in users (like a dashboard or account area), put them behind a login gate. Ask the AI to add authentication so visitors must sign in before they can view the page.
```
Add a login and only let signed-in users see the dashboard page.
```
You don't write server code, so input validation on saved data and form submissions is handled by Kleap. Still keep messages and inputs sensible on the page (e.g. required fields, reasonable lengths) for a good user experience.
## Forms
Contact and lead forms you add with Kleap are handled server-side by Kleap. Every submission is **validated, sanitized, and rate-limited** automatically, then delivered to your dashboard. There's nothing to configure and no keys to manage — spam and abuse protection is built in.
## Common Vulnerabilities
### What Kleap helps prevent
| Vulnerability | Protection |
| ---------------------------- | ------------------------------------------------------------------------ |
| **Exposed secrets** | Pre-build scanning; static sites carry no server secret keys |
| **XSS** | Content is auto-escaped by default; unsafe raw-HTML patterns are flagged |
| **Insecure transport** | HTTPS enforced automatically on every site and custom domain |
| **Form spam / abuse** | Kleap validates, sanitizes, and rate-limits every submission |
| **Data leaks between users** | Each user is scoped to their own rows |
### What you should keep in mind
* **Keep secrets out of the site** - Only publishable keys belong in a static site.
* **Don't expose sensitive data** - Don't display private information on a public page.
* **Protect the right pages** - Put account/dashboard pages behind a login.
* **Scope data per user** - Confirm each data feature is limited to the signed-in user.
## Security Checklist
Before launching, verify:
Only publishable keys are used; no secret keys, passwords, or private tokens anywhere in the site or your prompts.
If your app has logins, they use Kleap's built-in accounts.
If you store data, Kleap limits each user to their own rows.
Private pages (dashboards, account areas) are behind a login.
Your site and any custom domain load over HTTPS (automatic with Kleap).
## Reporting Vulnerabilities
Found a security issue? Contact us:
* Email: [security@kleap.co](mailto:security@kleap.co)
* We'll respond within 24 hours
* Responsible disclosure appreciated
## Compliance
* **GDPR** - Kleap supports EU data protection practices.
* **Encryption in transit** - All traffic is served over HTTPS/TLS.
* **Other requirements** - Have a specific compliance need? [Contact us](mailto:security@kleap.co).
Detailed guide to avoiding security pitfalls
# App Foundation
Source: https://docs.kleap.co/features/templates
The technology behind your Kleap sites
Every Kleap site is built on a modern, performance-first foundation designed for speed and SEO.
## Technology Stack
When Kleap builds your site, you get:
| Technology | Purpose |
| ----------------------- | -------------------------------------------------- |
| **Astro 5** | Fast, mostly-static site framework (great for SEO) |
| **Tailwind CSS v4** | Utility-first, responsive styling |
| **React 19 islands** | Interactivity only where it's needed |
| **TypeScript** | Type-safe components |
| **Global edge network** | Global hosting for your published site |
Kleap ships mostly static HTML by default, so your pages are fast and rank well. Interactive parts (menus, sliders, forms, dashboards) are added as React "islands" without slowing down the rest of the page.
## Project Structure
A generated Astro site is organized like this:
```
your-site/
├── src/
│ ├── pages/ # Each .astro file is a page/route
│ ├── components/ # Reusable .astro and .tsx components
│ ├── layouts/ # Shared page shells (Base.astro)
│ └── styles/ # global.css (Tailwind)
├── public/ # Static assets (images, fonts)
└── astro.config.mjs # Framework config (managed by Kleap)
```
You focus on describing pages and content — Kleap manages the configuration files (`astro.config.mjs`, build settings) for you.
## Building with AI
Instead of editing template code by hand, you describe what you want:
### Create Sections
```
Add a pricing section with three tiers:
Free, Pro, and Enterprise
```
### Add Pages
```
Add an About page and a Contact page,
and link them in the navigation
```
### Style Changes
```
Change the color scheme to blue
with a modern, clean design
```
## Adding Dynamic Features
Your site is static by default, but you can add dynamic capability when you need it:
* **Forms** — contact, lead, and newsletter forms work out of the box ([Forms & Data](/features/forms-data))
* **Database & accounts** — add **Kleap Database** for bookings, saved data, or user logins ([Kleap Database](/integrations/database))
* **Payments** — embed Stripe payment links or buttons ([Payments](/integrations/stripe))
## Best Practices
Begin with a basic description, then add sections and pages incrementally.
The more detail you provide, the better Kleap understands your vision.
Build in small steps. Check each change in the preview before moving on.
Create your first site
# What You Can Build
Source: https://docs.kleap.co/features/templates-gallery
The kinds of sites you can create with Kleap
Every Kleap site starts from a pre-configured Astro foundation that's ready to customize with AI.
## How It Works
When you create a new site, Kleap sets up:
* **Astro 5** for fast, static-first websites
* **Tailwind CSS v4** for styling
* **React 19 islands** for interactivity
* **TypeScript** for type safety
* **Kleap Database** available on demand (opt-in, added when your site needs saved data or logins)
## Building Your Site
Instead of choosing from pre-made templates, you describe what you want to build:
```
Create a SaaS landing page with pricing section,
features grid, and signup form
```
```
Build a business site with services, testimonials,
opening hours, and a contact form
```
```
Make an e-commerce product page with an image gallery,
reviews, and a "Buy now" button
```
The AI generates exactly what you need, customized to your requirements.
## What You Can Build
Product launches, waitlists, pricing and feature pages
Restaurants, agencies, local services, contact forms
Project showcases, about pages, personal sites
Articles, content pages, SEO-first sites
Product pages and catalogs with Stripe payment links
Logins and saved data with the built-in Kleap Database
Kleap sites are static and fast by default. Dynamic features — user accounts, saved data — come from the opt-in **Kleap Database**; payments use **Stripe payment links** (no server keys in your site). Advanced server-side flows (custom checkout webhooks, order management) need a separate backend.
## Benefits of the AI-First Approach
| Traditional Templates | Kleap AI Approach |
| --------------------- | ----------------------- |
| Limited customization | Unlimited flexibility |
| Generic designs | Tailored to your needs |
| Find and adapt | Describe and create |
| One-size-fits-all | Built for your use case |
## Get Started
Start building in minutes
# Version History
Source: https://docs.kleap.co/features/version-history
Track changes and roll back to previous versions
Every change to your app is tracked. You can view history and restore any previous version.
## How It Works
Kleap automatically saves a version when:
* You make changes via AI chat
* You edit files directly
* You publish to production
## Viewing History
### Access Version History
1. Click **Version history** beside the chat controls
2. Select a saved version to preview its state
### What You'll See
* **Timestamp** - When the change was made
* **Description** - What changed (from chat message)
* **Files changed** - Which files were modified
## Restoring Versions
### Roll Back to a Version
1. Find the version in history
2. Click **Restore this version**
3. Confirm the rollback
4. Your app reverts to that state
Restoring a version creates a new version with the old code. Your current work is preserved in history.
### Preview Before Restoring
Click on any version to preview what your app looked like at that point.
## Use Cases
### Undo a Bad Change
Made a change that broke something?
1. Open version history
2. Find the version before the change
3. Restore it
4. Try again with a different approach
### Compare Changes
See what changed between versions:
1. Select two versions
2. View the diff (file differences)
3. Understand what was modified
### Recover Lost Work
Accidentally deleted a component?
1. Find when it existed in history
2. Restore that version
3. Or copy just the parts you need
## Best Practices
Send clear, specific messages so version descriptions are useful.
Before big refactors, note your current version in case you need to roll back.
For important milestones, also push to GitHub for permanent backup.
## Version Limits
| Plan | Version History |
| ---------- | ----------------- |
| Free | Last 50 versions |
| Pro | Last 200 versions |
| Enterprise | Unlimited |
## Git Integration
For complete version control:
1. Connect GitHub in settings
2. Push your code
3. Use Git branches for experiments
4. Full history on GitHub forever
Set up Git version control
# AI Models
Source: https://docs.kleap.co/integrations/ai-models
The AI technology powering Kleap
Kleap uses advanced AI models to understand your requests and build your site.
## How Kleap Uses AI
When you send a message, Kleap:
1. **Understands** your intent and context
2. **Plans** the changes needed
3. **Generates** clean, production-ready code
4. **Applies** changes to your site
5. **Verifies** the result builds and looks right
## What the AI Can Do
Turn descriptions into real pages and layouts
Apply colors, typography, spacing, and animations with Tailwind
Menus, sliders, tabs, and forms via React islands
Wire up Kleap Database and user logins when needed
Metadata, structure, and content that ranks
Find and fix issues, then iterate
## What AI Does Best
* **Beautiful UI** — turning descriptions into polished, responsive designs
* **Content & SEO** — headings, copy, and structured metadata
* **Forms & lead capture** — contact, newsletter, and quote forms
* **Common patterns** — landing pages, portfolios, business sites, blogs
### What Needs More Guidance
* **Complex business logic** — be specific about the rules
* **Custom, unique designs** — reference examples or give detail
* **Advanced integrations** — describe the expected behavior
## Prompt Tips for Best Results
### Be Specific
```
❌ "Make it better"
✅ "Increase the hero heading to 3xl and add more padding around the cards"
```
### Provide Context
```
❌ "Add a button"
✅ "Add a 'Book a call' button next to the hero heading that links to my Calendly"
```
### Break Down Complex Tasks
Instead of:
```
Build a full booking site with accounts, payments, and admin
```
Try:
```
1. "Create a landing page for a barbershop with services and hours"
2. "Add a booking form that saves to a database"
3. "Add a Stripe buy button for deposits"
```
## Code Quality
AI-generated code follows modern best practices:
| Aspect | Standard |
| ----------------- | ------------------------------ |
| **Framework** | Astro 5 (mostly static, fast) |
| **Styling** | Tailwind CSS v4 |
| **Interactivity** | React 19 islands where needed |
| **Language** | TypeScript |
| **Accessibility** | Semantic HTML, ARIA labels |
| **SEO** | Metadata and structured markup |
## Context Understanding
The AI understands:
* **Your whole site** — existing pages, components, and patterns
* **Selected elements** — what you clicked in the preview
* **Conversation history** — earlier messages in the session
The more you build, the better the AI understands your project's style and preferences.
## Credits & Usage
Each AI message consumes credits based on how much work it does — see [Plans & Credits](/introduction/plans-and-credits). Tips to get more from each credit:
* Be concise but specific
* Use element selection to point at exactly what you mean
* Break large tasks into smaller messages
* Edit plain text directly in the preview (that's free)
## Privacy & Security
* Your code is processed securely to build your site
* **Never** paste secret keys, passwords, or private tokens into prompts
Learn how to write effective prompts
# Kleap Database
Source: https://docs.kleap.co/integrations/database
A built-in database and user accounts for your app
**Kleap Database** is a built-in database and authentication system for your site. When your app needs to save data or let people log in, Kleap can add a real database — a built-in database, kept private per user — without you managing any infrastructure.
Kleap Database is **optional and added on demand**. A simple marketing or landing site doesn't need it — it stays fast and static. You add a database only when your app needs stored data or user accounts.
## When to Use It
Use **Kleap Database** when your app needs to:
* Save records that persist (bookings, orders, reviews, submissions you query)
* Let visitors **create accounts and log in**
* Show each user their own private data
Use **[Forms & Data](/features/forms-data)** instead when you just need to collect contact/lead/newsletter submissions — forms already save to your dashboard and send email notifications, with zero setup.
## Adding a Database
The easiest way is to ask the AI:
```
Add a booking system where visitors pick a date and time,
and store the bookings in a database
```
```
Add user accounts with email and password login,
and a dashboard where each user sees their own data
```
Kleap provisions the database for that app and wires up the code. You can also enable it from the **Database** integration in your project settings.
## User Accounts
Kleap Database includes ready-made authentication for **your site's visitors** — email and password sign-up and login, with pre-built UI components.
```
Add a login and signup page, and protect the /dashboard
page so only logged-in users can see it
```
Behind the scenes each user only sees their own data, so it stays private by default.
Your site's user accounts (visitors logging into **your** app) are separate from your **Kleap account** (how you log in to build). They're two different systems.
## Viewing Your Data
Once a database is added, open **Settings > Project settings > Data Management** to browse the project's data — no SQL required.
## Working with Data
You describe changes in plain language and Kleap handles the schema and queries:
```
Add a "status" field to bookings with values pending, confirmed, cancelled
```
```
Create a reviews table with name, rating, and comment
```
Generated pages read and write data with a simple client (each user only sees their own data):
```tsx theme={null}
// Illustrative — Kleap writes this for you
import { db } from "@/lib/kleap-db";
// Read
const { data: bookings } = await db.from("bookings").select("*");
// Write
await db.from("bookings").insert({ date, time, name });
```
## Best Practices
Static sites are faster and simpler. Add Kleap Database when your app genuinely needs stored data or logins.
Contact and lead forms are better served by built-in Forms, which notify you by email automatically.
Each user sees only their own data by default. Keep it that way for anything private.
For contact and lead forms, use built-in Forms
# GitHub
Source: https://docs.kleap.co/integrations/github
Version control and code backup with GitHub
Push your Kleap app code to GitHub for version control, backup, and code ownership.
## Why GitHub?
* **Version control** - Track every change with Git
* **Backup** - Code stored safely in the cloud
* **Collaboration** - Work with developers
* **Two-way sync** - Changes flow both directions automatically
* **Portability** - Own and take your Astro source code anywhere
GitHub is for **backup, code ownership, and two-way sync** — it is **not** how your
site goes live. Kleap deploys your app automatically to Kleap's global edge at
`{your-app}.kleap.io` whenever you publish. Pushing to GitHub does **not** deploy
anything.
## Connecting GitHub
### One-Time Setup
1. Go to **Settings** > **Project settings** > **Integrations**
2. Choose **GitHub** and click **Connect**
3. Authorize Kleap in the popup
4. Select repository access
### Permissions Requested
* Read your profile
* Create repositories
* Push to repositories
* Read repository contents
We only access repositories you explicitly connect. Your other repos remain private.
## Pushing Code to GitHub
### Create New Repository
1. Open your app
2. Go to **Settings** > **Project settings** > **Integrations** > **GitHub**
3. Click **Create Repository**
4. Enter repository name
5. Choose public or private
6. Click **Create & Push**
### Connect Existing Repository
1. Open your app
2. Go to **Settings** > **Project settings** > **Integrations** > **GitHub**
3. Click **Connect Repository**
4. Select from your repositories
5. Confirm connection
Connecting to an existing repo will overwrite its contents. Make sure it's empty or a backup exists.
## Syncing Changes
Sync works in both directions: push to GitHub and Kleap syncs the changes in, and
changes made in Kleap are pushed back to GitHub. A last-commit-sha guard prevents
sync loops between the two sides.
### Push to GitHub
After making changes in Kleap:
1. Go to **Settings** > **Project settings** > **Integrations** > **GitHub**
2. Click **Push Changes**
3. Enter a commit message (optional)
4. Changes are pushed to your repo
### Auto-Push
Enable automatic syncing:
1. Go to **Settings** > **Project settings** > **Integrations** > **GitHub**
2. Toggle **Auto-push on publish**
3. Every publish also pushes to GitHub
## Repository Structure
Your GitHub repo contains the full Astro project — an Astro 5 static site with
Tailwind v4, React 19 islands, and TypeScript:
```
your-app/
├── src/
│ ├── pages/ # .astro pages and routes
│ ├── components/ # .astro and .tsx (React island) components
│ ├── layouts/
│ │ └── Base.astro # Shared page layout
│ └── styles/
│ └── global.css # Tailwind v4 styles
├── public/ # Static assets
├── astro.config.mjs # Astro config
├── package.json # Dependencies
└── tsconfig.json # TypeScript config
```
## Working with Developers
### Share with a Developer
1. Push your code to GitHub
2. Share the repository URL
3. Developer clones and runs locally:
```bash theme={null}
git clone https://github.com/you/your-app
cd your-app
npm install
npm run dev
```
### Merge Developer Changes
When a developer pushes changes:
1. Go to **Settings** > **Project settings** > **Integrations** > **GitHub**
2. Click **Pull Changes**
3. Changes are synced to Kleap
Manual merges may be needed if both sides have changes. Advanced Git knowledge helps here.
## Branches
### Default Branch
Kleap works with your default branch (usually `main` or `master`).
### Feature Branches
For experimental changes:
1. Developer creates branch locally
2. Makes changes and commits
3. Creates pull request
4. Merge to main when ready
5. Pull changes into Kleap
## GitHub Actions
Your repository can use GitHub Actions for:
* **Automated testing** - Run tests on push
* **Code quality** - Lint and format checks
* **Build checks** - Verify the Astro build passes
GitHub Actions run inside GitHub only. They don't publish your Kleap site —
deployment stays automatic through Kleap (to Kleap's global edge at `{your-app}.kleap.io`).
### Example Workflow
```yaml theme={null}
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm run lint
- run: npm run build
```
## Private vs Public
| Type | Visibility | Use Case |
| ----------- | -------------------------- | --------------------------------- |
| **Private** | Only you and collaborators | Client projects, proprietary code |
| **Public** | Anyone can view | Open source, portfolios |
## Disconnecting GitHub
To disconnect:
1. Go to **Settings** > **Project settings** > **Integrations** > **GitHub**
2. Click **Disconnect**
Your repository remains on GitHub. Only the Kleap connection is removed.
## Troubleshooting
* Check your GitHub connection is active
* Ensure you have write access to the repo
* Try disconnecting and reconnecting
* Pull changes before pushing
* Resolve conflicts manually if needed
* Consider using a developer for complex merges
* Ensure you granted access during OAuth
* Go to GitHub settings and update Kleap's permissions
* Try reconnecting your account
* GitHub has a 100MB file limit
* Use Git LFS for large assets
* Consider using a CDN for large images/videos
## Best Practices
Don't wait too long between pushes. Regular backups are safer.
Describe what changed in commit messages for future reference.
Keep client work and proprietary code in private repositories.
Always review developer changes before pulling into Kleap.
Use Kleap's built-in version history alongside GitHub
# Integrations Overview
Source: https://docs.kleap.co/integrations/overview
Connect services and add capabilities to your Kleap sites
Kleap sites are fast, mostly-static websites. Most of what you need is **built in** — hosting, forms, analytics, images, and an optional database. A few external services connect on top.
## Built-in Capabilities
Contact, lead, and newsletter forms with submissions in your dashboard — no setup.
Add a built-in database and user accounts when your app needs them.
Track visitors and pageviews out of the box.
Connect or buy a domain, with free automatic SSL.
## External Integrations
Two-way sync to back up and own your code. (Backup, not deployment.)
Add Stripe payment links and buttons to sell on your site.
Bring your own Supabase project for full control of your backend.
The AI that builds and edits your site.
## How It Works
* **Hosting & publishing** — open **Publish** when the reviewed draft is ready. Your site then goes live at `your-app.kleap.io`.
* **Forms** — work automatically on preview and published sites. Submissions appear in your dashboard.
* **Kleap Database** — added on demand: ask the AI to add saved data or user accounts, and Kleap provisions it for that app.
* **GitHub** — a one-time connection to sync your code to a repo.
* **Payments** — embed Stripe payment links/buttons (no server keys needed on a static site).
**Two ways to add a database.** For most sites, the built-in **[Kleap Database](/integrations/database)** needs no account and is managed for you. Prefer to run your own backend? Connect your own **[Supabase](/integrations/supabase)** project instead.
## Coming Soon
We're always adding new capabilities. Have a service you'd like integrated? [Let us know](mailto:hello@kleap.co).
# Payments
Source: https://docs.kleap.co/integrations/stripe
Accept payments on your Kleap site with Stripe
You can accept payments on your Kleap site using **Stripe**. Because Kleap sites are fast, mostly-static websites, the simplest and safest way to sell is with **Stripe Payment Links** and **Buy Buttons** — no server or secret keys required.
Stripe Payment Links and Buy Buttons are hosted by Stripe and embed with a public key only. That means no sensitive keys ever live in your site's code — which is safer and works perfectly with a static site.
## The Easy Way: Payment Links
A **Payment Link** is a Stripe-hosted checkout page you can link to from any button.
In your [Stripe Dashboard](https://dashboard.stripe.com), create a product and price (one-time or subscription).
Go to **Payment Links** → **New**, pick your product, and copy the link (looks like `https://buy.stripe.com/...`).
Ask the AI to add a buy button:
```
Add a "Buy now" button in the pricing section that links to
https://buy.stripe.com/your-link-here
```
That's it — clicks go to Stripe's secure checkout, and Stripe handles payment, receipts, and (for subscriptions) recurring billing.
## Buy Buttons & Pricing Tables
Stripe also offers embeddable **Buy Buttons** and **Pricing Tables** you can drop into a page. Create one in Stripe, then:
```
Embed this Stripe pricing table on my Pricing page:
```
Only ever use your **publishable key** (`pk_live_...` / `pk_test_...`) in your site. **Never** put a **secret key** (`sk_...`) in a website — it must stay private.
## Test vs Live Mode
| Mode | Keys / Links | Use |
| -------- | ----------------------------------- | ------------------- |
| **Test** | Test-mode payment links, `pk_test_` | Try the flow safely |
| **Live** | Live payment links, `pk_live_` | Real payments |
### Test Card Numbers
Use these in test mode:
| Card Number | Result |
| --------------------- | ------------------ |
| `4242 4242 4242 4242` | Success |
| `4000 0000 0000 0002` | Declined |
| `4000 0000 0000 3220` | Requires 3D Secure |
## Advanced: Custom Checkout
Fully custom, server-side Stripe flows (dynamic carts, metered billing, custom webhooks) require a backend to hold your secret key. That's beyond a static site — if you need it, you'd pair your site with your own backend or a serverless function. For most sites, Payment Links and Buy Buttons cover selling products, plans, and services.
## Best Practices
They're the fastest, safest way to sell on a static site — no keys in your code.
Only publishable keys belong in a website. Secret keys stay in Stripe / a backend.
Run a test-mode purchase end to end before switching to live links.
## Troubleshooting
Make sure the button links to a valid `https://buy.stripe.com/...` Payment Link, and that the link is set to **live** mode when you're ready for real payments.
Confirm you used your **publishable** key (`pk_...`) and the correct pricing-table ID from Stripe.
Add Kleap Database for orders, accounts, and saved data
# Supabase
Source: https://docs.kleap.co/integrations/supabase
Connect your own Supabase project to your site
Prefer to run your own backend? You can connect your own **Supabase** project to a Kleap site. This is the "bring your own database" option — for full control, if you already use Supabase, or if you want Supabase-specific features.
Not sure which to pick? **Kleap Database** is the built-in, zero-setup option — no account, managed for you. Choose **Supabase** when you want to own and manage the backend yourself. See [Kleap Database](/integrations/database).
## Kleap Database vs. Your Own Supabase
| | Kleap Database | Your own Supabase |
| ---------------- | ------------------------ | ------------------------------------- |
| Setup | Built in, on demand | You create a Supabase project |
| Managed by | Kleap | You |
| Best for | Fastest path, most sites | Full control, existing Supabase users |
| Where data lives | In Kleap | In your Supabase account |
## Connecting Your Supabase
In your [Supabase dashboard](https://supabase.com/dashboard), create a project and copy two values from **Project Settings → API**: your **Project URL** and your **anon (public) key**.
In Kleap, open **Settings > Project settings > Integrations**, choose **Supabase**, and click **Configure**. Then describe what you want to the AI:
```
Connect my Supabase project.
URL: https://xxxx.supabase.co
Anon key: eyJ...
Load posts from the "posts" table on the blog page.
```
Ask the AI to read and write your tables, add login, or show per-user data. It uses the Supabase client from your site's interactive parts.
## Keys & Security
Kleap sites are static, so anything in the site is public. That's fine for Supabase's **anon (public) key** — it's designed to be exposed, and your data is protected by the **Row Level Security** policies you set in Supabase.
Only use the **anon / public** key in your site. **Never** put your Supabase **`service_role` secret key** in a website — it bypasses all security. Service-role operations must run on a backend you control (a serverless function), not in the static site.
## What Works From a Static Site
Using the public key from your site's interactive parts, you can:
* **Read & write data** — protected per-user by your Row Level Security policies
* **User accounts** — Supabase Auth (email/password, magic link, OAuth), client-side
* **File storage** — public buckets or signed URLs
* **Realtime** — live updates when table data changes
### Needs a Backend
Anything requiring the **`service_role`** key — admin writes that bypass RLS, server-only logic, secure webhooks — must run in a separate serverless function, not in the static site.
## Managing Your Backend
Schema, RLS policies, auth providers, and storage buckets are managed in your **Supabase dashboard**, the same as any Supabase project. Ask the AI to generate the SQL or policies, then apply them in Supabase.
## Best Practices
Enable RLS on every table that holds user data. Since the public key is exposed in the browser, RLS is what keeps data private.
Never ship it in your site. Use it only from a backend you control.
If you just need saved data or logins without managing a backend, the built-in [Kleap Database](/integrations/database) is faster.
Use the built-in Kleap Database — no external account
# Contact Support
Source: https://docs.kleap.co/introduction/contact-support
Get help from the Kleap team
We're here to help you succeed with Kleap. Here's how to reach us.
## Support Channels
The chat bubble in the bottom-right corner of kleap.co. Our support assistant answers straight away and can look up your account, your apps and your billing; anything it cannot settle is passed to Kleap's founder.
**Available**: any time
Join our Discord for help from other builders and from Kleap's founder. Best for quick questions and discussions.
**Human replies**: included from Pro
Email us at **[hello@kleap.co](mailto:hello@kleap.co)** for account issues, billing questions, or detailed technical problems.
**Human replies**: included from Pro — billing and account problems on any plan
The support bubble is hidden inside the builder itself (`/chat` and `/sketch`) so it is never confused with the chat field you use to build your site. To reach support from the builder, open any other Kleap page — the homepage, your dashboard or the pricing page.
## Before Contacting Support
To help us resolve your issue faster, please:
1. **Check the docs** - Your question might be answered here
2. **Search Discord** - Someone may have asked the same question
3. **Try troubleshooting** - See our [Troubleshooting Guide](/tips/troubleshooting)
## What to Include
When reaching out, include:
What are you trying to do? What happens instead?
Which app is affected? Share the app name or ID.
How can we see the same issue?
Visuals help us understand faster.
Copy any error messages you see.
## Support Availability
All three channels are open on every plan. What your plan changes is whether a **human** answers.
| Channel | Open to | Best for |
| ---------------- | -------- | ---------------------------------------------------------- |
| Chat on kleap.co | Everyone | Anything about your own account, apps, credits or billing |
| Discord | Everyone | Quick questions, discussions, and feature ideas |
| Email | Everyone | Accounts, billing, security, and detailed technical issues |
**Human support is included from Pro.** On Business your message is triaged first, ahead of Pro. On Free and Launch the assistant helps you as far as it can and you are welcome on Discord and by email, but a human reply is not part of the plan — we would rather say so than let you wait for one.
**Money, data and our own bugs are never gated by a plan.** A billing question, a refund, a double charge, a failed payment, lost data, a bug on our side that burned your credits, or an account change only we can make reaches a human **on any plan, including Free**. That is us fixing our own side, not support.
Kleap is founder-run: human support is **one person**, not a rota, so there are no staffed support hours and no guaranteed response time. A site that is down or a failed payment is looked at first; everything else is answered in turn, and a weekend or a busy week can stretch that out. "Priority" means triaged first, never answered within a set time. Contractual support terms, if any, are stated in the relevant agreement.
## Feature Requests
Have an idea to make Kleap better?
1. Post it in our [Discord community](https://discord.gg/WhQrT8RneY), or email **[hello@kleap.co](mailto:hello@kleap.co)**
2. Say what you are trying to build and why the current features do not get you there
3. It reaches the founder directly — there is no committee in between
## Bug Reports
Found a bug?
1. Tell us in the chat on kleap.co, on [Discord](https://discord.gg/WhQrT8RneY), or at **[hello@kleap.co](mailto:hello@kleap.co)**
2. Include steps to reproduce
3. Share screenshots if possible
4. We'll investigate and follow up
## Social Media
Stay updated on new features and tips:
* LinkedIn: [Kleap](https://www.linkedin.com/company/kleap)
* Discord: [Kleap community](https://discord.gg/WhQrT8RneY)
* GitHub: [github.com/kleaphq](https://github.com/kleaphq)
Get help and connect with other Kleap users
# FAQ
Source: https://docs.kleap.co/introduction/faq
Frequently asked questions about Kleap
Find answers to common questions about using Kleap.
## General
You can create apps, internal tools, websites, logos, animations, and other digital projects. Web projects include:
* Landing and marketing pages
* Business and local-service sites
* Portfolios and personal sites
* Blogs and content sites
* Pricing and product pages
* Web apps and internal tools with logins and saved data (via Kleap Database)
Generated web projects use Astro 5 with Tailwind CSS v4 and interactive React islands. For dynamic features (accounts, saved data) add the built-in Kleap Database; for payments use Stripe payment links.
No! Kleap is designed for everyone. Simply describe what you want in plain language, and the AI generates the code. However, if you do know code, you can view and edit the source files directly.
You do. 100%. Export to GitHub anytime, download the source files, or deploy anywhere you want. There's no lock-in.
Sites are built with:
* **Astro 5** - Fast static-site framework
* **Tailwind CSS v4** - Utility-first styling
* **React 19 islands** - Interactive components only where you need them
* **TypeScript** - Type-safe JavaScript
* **Kleap Database** (optional) - a built-in managed database with user accounts, where each user only sees their own data, added on demand
* **Kleap Hosting** - a global edge network with automatic SSL
## Preview & Publishing
The preview is a real build of your site, rendered right inside the Kleap editor. It refreshes automatically after each generation so you always see the current version — there's no separate preview URL to manage and nothing that "stops".
* **Preview**: A live build inside the editor, updated as you make changes. It lives in the editor, not at a separate URL.
* **Production URL** (`your-app.kleap.io`): Your permanent, public URL after publishing. Always online on a global edge network.
Once you click **Publish**, your site is live at `your-app.kleap.io` and you can share that link — visitors don't need to log in. Until you publish, the site exists only in your editor. After publishing, click **Update** whenever you want your latest changes to go live.
## Billing & Credits
Credits are usage-based, not a flat cost per message. A small text or style change costs a fraction of a credit, while a full page or complex feature costs more. Image generation and direct text editing are free. See [Plans & Credits](/introduction/plans-and-credits) for details.
Your apps stay online and functional. You just can't make new AI changes until you get more credits (daily refresh, upgrade, or purchase).
New subscription purchases may be refunded within 7 days if fewer than 20% of the included credits have been used. Consumed credits, renewals, domains, and one-off credit purchases are non-refundable. Contact [hello@kleap.co](mailto:hello@kleap.co).
## Apps & Deployment
App and publishing limits depend on your plan — see [kleap.co/pricing](https://kleap.co/pricing) for the current numbers.
Publishing costs no AI credits. Plan availability and published-app limits are listed on [kleap.co/pricing](https://kleap.co/pricing). Published web projects include SSL and delivery on Kleap's edge network.
Yes. Point your domain's A record to Kleap (root domains use an A record, never a CNAME) and SSL is issued automatically. You can also buy a domain directly inside Kleap.
Absolutely. Push to GitHub with one click, or download the source files. Your code is yours.
## Database & Forms
No setup required. When you ask for features that need data storage, Kleap adds its built-in **Kleap Database** (a managed database with built-in email/password user accounts, where each user only sees their own data) on demand. You don't connect or manage an external provider.
Yes — Kleap Database is built into the platform, with no separate third-party account or bill. Availability and limits depend on your plan; see [kleap.co/pricing](https://kleap.co/pricing).
Forms are built in. Add a `KleapForm` and submissions show up in your dashboard with email notifications — no setup and no third-party service.
Yes. Your database and form submissions are managed inside Kleap — the AI creates and updates tables as your app needs them, and you can view form submissions from your dashboard.
## Security
Yes. Your code is stored securely and only accessible by you (and team members you invite). We don't share or sell your code.
Apps follow security best practices by default. However, always review sensitive features and enable proper authentication for production apps.
## Still have questions?
Chat, Discord or email — all three reach Kleap's founder
# Getting Started
Source: https://docs.kleap.co/introduction/getting-started
Build your first site with Kleap in 5 minutes
Follow these steps to create and publish your first site with Kleap.
## Step 1: Sign Up
Go to [kleap.co](https://kleap.co) and create your account:
1. Click **Get Started**
2. Sign in with **Google**, an email **magic link**, or a **6-digit email code**
3. You'll receive free credits to start building
No credit card required. Start building immediately with your free credits.
## Step 2: Describe Your Site
Tell Kleap what you want to build in the chat box:
```
Create a landing page for a coffee shop with a hero section,
menu with prices, opening hours, and a contact form
```
The AI generates your site from your description — no template picking, no setup. The more specific you are, the closer the first result.
Want ideas? Browse the [showcase](/use-cases/showcase) to see what others have built.
## Step 3: Edit with AI
Once your site is created, continue the conversation to refine it:
```
Add a dark mode toggle to the header
```
```
Change the primary color to blue
```
```
Add a contact form to the footer
```
Each change updates your site in real-time in the preview panel.
Be specific in your requests. Instead of "make it better", try "increase the font size of headings and add more padding between sections".
## Step 4: Preview Your Site
Your site shows in a live preview on the right side of the screen:
* **Real-time updates** as you make changes
* **Mobile responsive** - resize to test different screens
* **Interactive** - click buttons, fill forms, test functionality
The preview is a real build of your site rendered inside the editor. It refreshes automatically after each generation — there's no sandbox to restart and no separate preview URL.
## Step 5: Publish Your Site
Your draft stays private until you publish it:
1. Click the **Publish** button in the top bar
2. Review the website address in the Publish panel
3. Click **Publish** in the panel and wait for the build to complete
4. Your site is live at `your-app.kleap.io`
Hosting is free, on a global edge network with automatic SSL.
## Step 6: Connect a Custom Domain (Optional)
Want your own domain like `myapp.com`?
1. Go to **Settings** > **Domains**
2. Click **Add Domain**
3. Enter your domain name
4. Follow the DNS setup instructions
5. SSL is automatically configured
Buy a domain right inside Kleap, or bring one from any registrar. Root domains connect with an **A record** (never a CNAME); if your DNS is on Cloudflare, set the record to **DNS only**.
## What's Next?
Master prompting for better results
See the kinds of sites Kleap creates
Turn on Kleap Database — a managed database and user accounts, built in
Version control your code
# Plans & Credits
Source: https://docs.kleap.co/introduction/plans-and-credits
Understanding Kleap's pricing, plans, and credit system
Kleap uses a credit-based system. Credits are consumed when you use the AI to build and edit projects. Publishing actions do not consume AI credits; publishing availability, hosting, and published-project limits depend on your plan.
Plans and prices below are current entry points. For the live, up-to-date pricing and credit sliders, visit [kleap.co/pricing](https://kleap.co/pricing).
## Pricing Plans
| Plan | Price | Best for | Monthly AI credits |
| -------------- | ----------------- | ------------------------------- | --------------------------------------------- |
| **Free** | \$0 | Trying Kleap, small sites | 5 free credits per day |
| **Launch** | $9/mo (or $99/yr) | Publishing with your own domain | Hosting only — keeps the 5 free daily credits |
| **Pro** | from \$25/mo | Growing businesses | from 100 credits/mo (scalable) |
| **Business** | from \$50/mo | Scaling teams | from 100 credits/mo (scalable) |
| **Enterprise** | Custom | Large teams | Custom — [contact us](mailto:hello@kleap.co) |
### How Pro & Business scale
Pro and Business aren't fixed tiers — you pick how many monthly AI credits you need with a slider, and the price scales with it (from 100 credits up to 10,000+). **Business** includes everything in **Pro** plus team features: **SSO**, **design templates**, **private projects**, and the option to **opt out of data training**.
Paid plans bill **monthly or yearly** — yearly billing is discounted. See [kleap.co/pricing](https://kleap.co/pricing) for exact annual savings.
Every plan — including Free — includes **5 free AI credits per day**. **Launch** is a hosting plan: it unlocks a custom domain and always-on hosting, and keeps your daily free credits, but doesn't add a monthly credit pool.
## How Credits Work
### Free daily credits
Every user can claim **5 free credits** once every 24 hours.
* **Claim frequency**: once per 24 hours
* **Credits per claim**: 5
* **Free-plan cap**: up to 30 claims per month
### Paid monthly credits
Paid plans add a monthly pool of AI credits on top of the daily free ones.
* **Paid credits roll over** — they never expire
* Free daily credits are used first, then your paid balance
### Credit consumption
Credits are **usage-based**, not a flat cost per message. A short tweak costs a fraction of a credit; a large, complex build costs more. As a rough guide:
| Action | Estimated Credits |
| -------------------------- | ----------------- |
| Small text or style change | Under 1 credit |
| New section or component | 1–3 credits |
| Full page creation | 3–8 credits |
| Large, complex feature | 8+ credits |
**Image generation is free** — it doesn't consume credits. **Text editing** (clicking text in the preview and typing) is also free.
### Credit top-ups
Paid subscribers can buy a one-off pack without changing plans from [kleap.co/credits](https://kleap.co/credits). Sign in with the subscribed account to see the available packs:
| Pack | Credits |
| ------- | ------- |
| Starter | 50 |
| Popular | 150 |
| Pro | 400 |
| Max | 1,000 |
Prices are shown in your own currency on the page. Top-ups add to your balance and leave your plan untouched.
Your **first paid subscription** also includes a **+50% bonus** on that plan's monthly credits.
### What happens when you run out?
* Your published sites keep working normally
* You can't make new AI edits until you get more credits
* Options: wait for your next daily credits, upgrade your plan, or earn referral credits
## Referral Program
Earn bonus credits by inviting friends:
| Who | Credits Earned |
| ------------------------- | --------------------------------------------------------------------------------------------------- |
| **Your friend (referee)** | +5 credits, immediately on signup |
| **You (referrer)** | +10 credits once your friend actually uses Kleap — they publish a site and come back on a later day |
| **You (referrer)** | +100 credits if your friend subscribes to a paid plan, released after a 7-day verification period |
A signup on its own earns the referrer nothing. The +10 is released when your friend genuinely
gets going, which is what keeps the program honest for everyone.
Free referral rewards are capped at 100 credits over the lifetime of your account, with a maximum
of 3 grants per 30 days. Paid-conversion rewards are outside that cap.
### How to Refer
1. Go to [kleap.co/referral](https://kleap.co/referral)
2. Copy your unique referral link
3. Share it with friends
4. Your friend gets their 5 credits straight away; yours arrive once they start building
## Free Actions
These never consume credits:
* Viewing and browsing your sites
* Publishing or updating an eligible web project (plan access and hosting limits still apply)
* Connecting an eligible custom domain (plan access still applies)
* Editing text directly in the preview
* Generating images
* Viewing version history and the code editor
* Managing account and team settings
## Billing FAQ
Your sites keep working. You just can't make new AI edits until your next daily credits arrive, you buy a top-up, or you upgrade.
No. Paid monthly credits roll over and never expire. Free daily claims add to your balance on top.
Yes. Cancel from Settings and keep access until the end of your billing period.
Both. Yearly billing is discounted versus monthly — see [kleap.co/pricing](https://kleap.co/pricing) for exact savings.
Open your dashboard and claim once every 24 hours.
See the latest plans and pricing on kleap.co
# Welcome to Kleap
Source: https://docs.kleap.co/introduction/welcome
Turn an idea into a live website, app, store, or internal tool with AI
Kleap is an AI builder for real digital products. Describe what you want in plain language, refine it through conversation, and publish it without setting up a development stack or deployment pipeline.
## What can you build?
Launch a fast, responsive site for a business, campaign, portfolio, or new idea.
Build interactive products with pages, dashboards, accounts, and application logic.
Turn a workflow into a focused tool for your team, customers, or operations.
Create structured, searchable experiences for products, services, listings, or content.
## From prompt to live product
Start with the audience, the goal, and the essential pages or features. You do not need to choose a template or write code.
Kleap builds a first version that you can preview immediately. Continue the conversation to change the copy, layout, styling, or functionality.
Publish to your `kleap.io` address, connect a custom domain, then add forms, a database, accounts, analytics, or integrations when you need them.
## Start with a clear prompt
You can begin with a rough idea. A little context helps Kleap produce a stronger first version.
```text theme={null}
Create a welcoming website for a neighborhood coffee shop.
Include the menu, opening hours, location, and a contact form.
Use warm colors and make it easy to read on mobile.
```
```text theme={null}
Build a client portal for a small design studio.
Clients should be able to sign in, view project milestones,
download deliverables, and send feedback.
```
```text theme={null}
Create an inventory dashboard for a three-location bakery.
Show current stock, low-stock alerts, and a form for recording
deliveries. Make each location easy to filter.
```
Describe the result you want before prescribing the implementation. You can always refine individual sections and features after the first version appears.
## Everything stays in one place
Create and change your product through conversation.
Test the real result while you build, including responsive layouts and interactions.
Add stored data, user login, dashboards, and per-user access when your product needs them.
Go live on Kleap hosting, then connect your own domain with HTTPS.
Collect leads, messages, signups, and structured information.
Inspect the source and keep a copy in GitHub when you want more control.
## Choose your next step
Follow the practical guide from first prompt to published result.
Explore websites, apps, stores, and other starting points.
Learn how to give useful context and iterate with precision.
Find the support channels when you need a hand.
# Why Kleap?
Source: https://docs.kleap.co/introduction/why-kleap
What makes Kleap the best choice for building websites with AI
There are many AI website builders. Here's why entrepreneurs, designers, and developers choose Kleap.
## Key Differentiators
### Fast, SEO-Ready Output
Kleap builds real websites on a modern, performance-first stack:
* **Astro 5** — ships mostly static HTML, so pages load fast and rank well
* **Tailwind CSS v4** — clean, responsive design
* **React 19 islands** — interactivity only where you need it, without slowing the whole page
* **SEO & GEO optimized** — structured markup and metadata built in, so both Google and AI answer engines can read your site
### Real Publishing, Not Just Previews
Your site isn't trapped in a sandbox. With Kleap you get:
* **Deliberate publishing** to `your-app.kleap.io` on a global edge network
* **Custom domains** with free, auto-renewing SSL
* **GitHub sync** to back up and own your code
* **Full access** to your source files and a built-in code editor
### Built-in Essentials
No extra services to wire up:
| Capability | Included |
| ------------------------ | --------------------------------------------- |
| Contact & lead forms | Yes — submissions in your dashboard |
| Database & user accounts | Optional — add **Kleap Database** when needed |
| Analytics | Yes — visitors and pageviews |
| Images | Upload your own or generate with AI |
| Hosting & SSL | Yes — global edge, always on |
### Transparent Pricing
A simple credit-based system with no hidden fees:
* **Free tier** with daily credits to get started
* **Paid credits roll over** and never expire
* **No per-deployment charges** — publishing is always free
* See live plans at [kleap.co/pricing](https://kleap.co/pricing)
## What You Can Build
Marketing pages and product launches
Restaurants, agencies, local services
Personal sites and showcases
Content-driven, SEO-first sites
Forms, quotes, and reservations
Add a database and logins with Kleap Database
Build your first site in 5 minutes
# Best Practices
Source: https://docs.kleap.co/prompting/best-practices
Advanced techniques for writing effective prompts
Master these techniques to get the most out of Kleap's AI.
## Plan Before Prompting
Before writing, think about:
1. **What** do you want to build?
2. **How** should it look and behave?
3. **Where** should it go in your app?
4. **What** existing elements does it interact with?
## Break Down Complex Tasks
Large requests often fail. Instead, break them into steps:
### ❌ Too Much at Once
```
Build a complete e-commerce site with product listings, shopping cart,
checkout, user accounts, order history, and admin dashboard
```
### ✅ Step by Step
```
Step 1: "Create a product listing page with a grid of product cards
showing image, name, price, and 'Add to Cart' button"
Step 2: "Add a shopping cart sidebar that shows added items and
calculates the total"
Step 3: "Create a checkout page with shipping address form"
Step 4: "Add user authentication for checkout"
Step 5: "Create an order confirmation page"
```
## Be Specific About Design
### Vague (Unpredictable Results)
```
"Make a nice looking hero section"
```
### Specific (Consistent Results)
```
"Create a hero section with:
- Centered text layout
- Large heading (4xl) with gradient text from blue to purple
- Subheading in gray-600
- Two buttons: primary 'Get Started' and secondary 'Learn More'
- Background with subtle dots pattern"
```
## Reference Existing Elements
Instead of describing from scratch, reference what exists:
```
"Copy the card style from the features section and use it for the
testimonials section"
```
```
"Make this button match the primary button in the header"
```
```
"Use the same color scheme as the pricing cards"
```
## Use Technical Terms When You Know Them
If you know React/CSS/Tailwind terms, use them:
```
"Add a flex container with justify-between and items-center"
```
```
"Make this an interactive React island that loads my bookings from the Kleap Database"
```
```
"Add a useState hook to track the selected tab"
```
But if you don't know the terms, plain English works fine:
```
"Put these items side by side with space between them"
```
## Provide Examples
When you have something specific in mind:
```
"Create a pricing table similar to Stripe's pricing page, with
three tiers and a toggle for monthly/annual billing"
```
```
"Make the hover effect on these cards like Apple's product cards -
subtle lift and shadow"
```
## State Preferences Upfront
If you have styling preferences, mention them early:
```
"I prefer rounded corners, subtle shadows, and plenty of whitespace.
Create a dashboard layout with these preferences in mind."
```
## Handle Edge Cases
Think about what happens in different scenarios:
```
"Create a product list that:
- Shows a loading spinner while fetching
- Shows 'No products found' if the list is empty
- Shows an error message if the fetch fails"
```
## Iterate, Don't Start Over
Build on what you have:
### ❌ Starting Fresh
```
"That's wrong, make a completely different hero section"
```
### ✅ Iterating
```
"The hero is good but:
- Make the heading smaller
- Change the button color to blue
- Add more padding on mobile"
```
## Common Patterns
### Adding Pages
```
"Create a new page at /about with:
- Company story section
- Team member cards
- Office locations map"
```
### Contact Forms
```
"Add a contact form with name, email, and message fields.
Save the submissions to my dashboard and email me a
notification whenever someone submits."
```
### Databases
```
"Add a bookings database. Let visitors submit a booking,
and show my upcoming bookings in a table on a private page."
```
### Accounts
```
"Add email/password accounts:
- A signup page at /signup
- A login page at /login
- A members-only dashboard only logged-in users can see
- A user menu in the header when logged in"
```
### Responsive Design
```
"Make this layout:
- Single column on mobile
- Two columns on tablet
- Three columns on desktop"
```
## Prompting Patterns
### The "Create X with Y" Pattern
```
"Create [component] with [features/characteristics]"
Example: "Create a testimonial carousel with auto-play,
dots navigation, and quote cards"
```
### The "When X, Do Y" Pattern
```
"When [trigger], [action]"
Example: "When the user scrolls down 100px, make the
header background solid instead of transparent"
```
### The "Like X but Y" Pattern
```
"Make it like [reference] but [changes]"
Example: "Like the existing contact form but with
additional phone number and company fields"
```
## Quality Checklist
Before sending a complex prompt, check:
* [ ] Is the goal clear?
* [ ] Are all requirements specified?
* [ ] Did I mention any specific styling?
* [ ] Did I consider mobile/desktop?
* [ ] Did I reference existing elements if relevant?
* [ ] Is this small enough to succeed in one go?
What to do when things don't work as expected
# Debugging
Source: https://docs.kleap.co/prompting/debugging
How to fix errors and troubleshoot issues
When something goes wrong, Kleap's AI can help you fix it. Here's how to effectively debug issues.
## Types of Errors
### Build Errors
Happen when code can't compile:
* Syntax errors
* Missing imports
* Type errors
* Invalid JSX
**What you see**: Error message in the chat or preview
### Runtime Errors
Happen when the app runs:
* Undefined variables
* Failed API calls
* Null reference errors
* Logic bugs
**What you see**: Error in the preview or browser console
### Visual Bugs
The code works but doesn't look right:
* Wrong colors or sizing
* Broken layouts
* Missing elements
* Responsive issues
**What you see**: Unexpected appearance in preview
## Debugging Workflow
Read the error message carefully. What does it say?
Paste the error message in chat
Explain what you were trying to do
AI will analyze and propose a fix
Check if the issue is resolved
## Effective Error Reporting
### Include the Error Message
```
I'm getting this error:
"TypeError: Cannot read properties of undefined (reading 'map')"
on the products page
```
### Describe What Happened
```
I was trying to add a product list to the homepage.
The AI generated the code but now the page shows a white screen.
Here's the error from the console: [error message]
```
### Mention What Changed
```
After adding the user authentication, the dashboard page
stopped loading. It was working before that change.
```
## Common Errors and Solutions
### "Cannot find module"
```
Error: Cannot find module '@/components/Button'
```
**Causes**:
* Component doesn't exist
* Wrong import path
* Typo in filename
**Fix prompt**:
```
I'm getting a "Cannot find module '@/components/Button'" error.
Can you check if the file exists and fix the import?
```
### "Hydration mismatch"
```
Hydration failed because the initial UI does not match
what was rendered on the server
```
**Causes**:
* Different content on server vs client
* Using `window` or `localStorage` without checks
* Date/time rendering
**Fix prompt**:
```
I'm getting a hydration error on the dashboard.
Can you fix the component to avoid server/client mismatch?
```
### "X is not a function"
```
TypeError: bookings.map is not a function
```
**Causes**:
* The data isn't an array yet (still loading)
* Unexpected shape returned from the Kleap Database
* Missing initial value
**Fix prompt**:
```
Getting "bookings.map is not a function" when my bookings
island loads data from the Kleap Database. Can you check how
the data is fetched and rendered?
```
### "Failed to fetch"
```
Error: Failed to fetch
```
**Causes**:
* The form isn't wired to send submissions
* Network problem
* The Kleap Database read was blocked
**Fix prompt**:
```
My contact form shows "Failed to fetch" when I submit it.
Can you make sure the form sends submissions to my dashboard?
```
## Visual Debugging
When something looks wrong but there's no error:
### Describe What's Wrong
```
The cards are stacking vertically but I want them in a 3-column grid.
They also have no space between them.
```
### Reference What You Expected
```
The hero section should have the image on the right and text on
the left, but they're both centered in a column.
```
### Use Element Selection
1. Click **Edit** in the builder toolbar
2. Click the broken element
3. Describe what's wrong
4. AI has context to fix it
```
[After selecting element]
"This card is too narrow and the text is overflowing"
```
## When AI Can't Fix It
### Provide More Context
```
The error might be related to [your suspicion].
Here's the relevant code: [paste code]
```
### Try a Different Approach
```
The fix didn't work. Can we try a different approach?
Maybe [alternative solution]?
```
### Undo and Restart
If things are too broken:
1. Open version history
2. Restore to a working version
3. Try a different approach
```
Let's go back to the version before adding payments.
I want to try implementing it differently.
```
## Debugging Kleap Database Issues
### Data Not Loading
```
My bookings aren't showing up from the Kleap Database. Can you check:
1. The data is read from the right table
2. The access rules allow reading this data
3. I'm logged in, if the data requires an account
```
### Empty Results
```
This list is empty but there's data in the table.
Can you check how the data is queried and the access rules?
```
### Account Issues
```
Accounts aren't working. After signup, the user
doesn't stay logged in. Can you check the login flow?
```
## Prevention Tips
Don't wait until you've made many changes. Test after each significant addition.
Make one change, verify it works, then move on. Easier to debug.
If something breaks badly, you can always roll back.
Error messages often tell you exactly what's wrong. Share them with AI.
## Browser DevTools
For advanced debugging:
1. **Open DevTools** - Right-click → Inspect (or F12)
2. **Console tab** - See JavaScript errors
3. **Network tab** - Check API calls
4. **Elements tab** - Inspect HTML/CSS
Share what you find:
```
In the Network tab, the request that loads my bookings returns 500.
The response body says: [error message]
```
Solutions to common problems
# Prompting Overview
Source: https://docs.kleap.co/prompting/overview
How to communicate effectively with Kleap's AI
The key to building great apps with Kleap is writing effective prompts. This guide will help you communicate clearly with the AI.
## The Basics
A prompt is simply a message describing what you want to build or change. The better your prompt, the better the result.
### Good Prompt Characteristics
State exactly what you want, not what you don't want
Include details about styling, behavior, and placement
Reference existing elements or pages when relevant
One task per prompt for best results
## Prompt Examples
### Creating Components
```
❌ Vague: "Add a header"
✅ Specific: "Add a header with the logo on the left, navigation
links (Home, Features, Pricing) in the center, and a 'Get Started'
button on the right"
```
### Styling Changes
```
❌ Vague: "Make it look better"
✅ Specific: "Change the background to a gradient from blue-500
to purple-600, increase the heading size, and add more spacing
between the cards"
```
### Adding Features
```
❌ Vague: "Add user accounts"
✅ Specific: "Add user authentication with email/password signup,
a login page, and protect the dashboard route so only logged-in
users can access it"
```
## Prompt Structure
A well-structured prompt typically includes:
### 1. Action
What you want to do (create, add, change, fix, remove)
### 2. Subject
What element or feature you're targeting
### 3. Details
Specific requirements, styling, or behavior
### Example
```
[Action] Create
[Subject] a pricing section
[Details] with three tiers (Free, Pro, Enterprise), showing price,
features list, and a CTA button for each. Use a card layout with
the Pro tier highlighted.
```
## Using Element Selection
Click on elements in the preview to give the AI context:
1. **Click** the element you want to modify
2. **Type** your change request
3. AI knows exactly what you're referring to
```
[After selecting a button]
"Make this larger and change the text to 'Start Free Trial'"
```
This is often more effective than describing the element in text.
## Iteration
Building is iterative. Start simple and refine:
"Create a landing page with a hero section, features, and footer"
"Add three feature cards with icons to the features section"
"Make the hero background a gradient and increase the heading size"
"Make the email signup form save to the database"
## When Things Go Wrong
If the AI doesn't get it right:
1. **Clarify** - Rephrase with more detail
2. **Correct** - "That's not quite right, I wanted..."
3. **Undo** - Use version history if needed
4. **Break down** - Split complex requests into steps
## Credit Usage
Each prompt uses credits based on:
* Length of your message
* Complexity of the response
* Amount of code generated
Concise, specific prompts are more credit-efficient than vague ones that require multiple iterations.
## Next Steps
Advanced techniques for better results
How to fix errors and troubleshoot
# Comparisons
Source: https://docs.kleap.co/reference/comparisons
How Kleap compares to alternatives
See how Kleap compares to other tools for building web applications.
## Kleap vs Lovable
Both are AI-powered app builders with similar capabilities.
| Feature | Kleap | Lovable |
| ------------------ | -------------------------------------- | -------------- |
| AI Chat | ✓ | ✓ |
| Live Preview | ✓ | ✓ |
| Code Editor | ✓ | ✓ |
| Element Selection | ✓ | ✓ |
| **Framework** | Astro 5 (static-first + React islands) | Vite + React |
| **Deployment** | Kleap Hosting (kleap.io) | Lovable Cloud |
| **Database** | Kleap Database (built-in) | Third-party DB |
| **UI / Styling** | Tailwind CSS v4 + React islands | Third-party UI |
| Version History | ✓ | ✓ |
| GitHub Integration | ✓ | ✓ |
| Custom Domains | ✓ | ✓ |
| Team Collaboration | ✓ | ✓ |
### When to Choose Kleap
* Prefer fast, static-first sites (Astro 5 ships minimal JavaScript)
* Want automatic, integrated deployment with Kleap hosting
* Building SEO-focused, content-driven sites
* Need static site generation with React islands for interactivity
### When to Choose Lovable
* Prefer Vite's faster dev experience
* Want Lovable's integrated hosting
* Already invested in Lovable ecosystem
## Kleap vs Bolt.new
Bolt is a general-purpose AI coding environment.
| Feature | Kleap | Bolt |
| ------------------ | ------------------------- | ----------------------- |
| AI Chat | ✓ | ✓ |
| Live Preview | ✓ | ✓ |
| **Focus** | Web apps | Any code |
| **Framework** | Astro 5 | Various |
| **Database** | Kleap Database (built-in) | Manual setup |
| **Authentication** | Built-in | Manual setup |
| **Deployment** | Automatic | Manual |
| Starter Template | ✓ | Limited |
| Custom Domains | ✓ | Via deployment platform |
### When to Choose Kleap
* Building web applications specifically
* Want integrated database and auth
* Prefer guided, opinionated setup
* Need quick deployment
### When to Choose Bolt
* Building non-web projects
* Want framework flexibility
* Prefer more control over setup
* Exploring multiple technologies
## Kleap vs v0
v0 generates UI components.
| Feature | Kleap | v0 |
| -------------- | --------- | ---------- |
| AI Chat | ✓ | ✓ |
| **Output** | Full apps | Components |
| Live Preview | ✓ | Limited |
| Database | ✓ | ✗ |
| Authentication | ✓ | ✗ |
| Deployment | ✓ | Copy code |
| Edit & Iterate | ✓ | Limited |
| Custom Logic | ✓ | ✗ |
### When to Choose Kleap
* Building complete applications
* Need database and auth
* Want deployment built-in
* Building functional features
### When to Choose v0
* Generating UI components only
* Prototyping designs quickly
* Need component code to paste elsewhere
* Exploring design variations
## Kleap vs No-Code Builders
Comparison with Webflow, Bubble, etc.
| Feature | Kleap | No-Code |
| ------------------ | ---------------------- | --------------------- |
| **Learning Curve** | Low (natural language) | Medium (visual tools) |
| **Flexibility** | High (full code) | Limited |
| **Code Access** | Full ownership | Varies |
| **Export** | Yes (to GitHub) | Often limited |
| **Performance** | Optimized | Varies |
| **SEO** | Full control | Limited |
| **Custom Logic** | Unlimited | Platform-dependent |
| **Lock-in** | None | Often significant |
### When to Choose Kleap
* Want code ownership
* Need maximum flexibility
* Building complex logic
* Care about performance
* Want to avoid lock-in
### When to Choose No-Code
* Non-technical and prefer visual building
* Simple use case that fits their templates
* Don't need code export
* Team already knows the platform
## Kleap vs Traditional Development
Comparison with coding from scratch.
| Aspect | Kleap | Traditional |
| ------------------ | --------------- | -------------- |
| **Speed** | 10x faster | Baseline |
| **Skill Required** | Basic prompting | Full-stack |
| **Flexibility** | High | Unlimited |
| **Learning** | Implicit | Required |
| **Cost** | Subscription | Developer time |
| **Code Quality** | Consistent | Varies |
| **Maintenance** | AI can help | Manual |
### When to Choose Kleap
* Speed is priority
* Don't have developer resources
* Building standard web app patterns
* Want to iterate quickly
* Prototyping ideas
### When to Choose Traditional
* Highly specialized requirements
* Need pixel-perfect custom designs
* Building complex backend systems
* Team of experienced developers
* Very specific architecture needs
## Feature Matrix
| Feature | Kleap | Lovable | Bolt | v0 |
| --------------- | ----- | ------- | -------- | -- |
| AI Chat | ✓ | ✓ | ✓ | ✓ |
| Full Apps | ✓ | ✓ | ✓ | ✗ |
| Database | ✓ | ✓ | Manual | ✗ |
| Auth | ✓ | ✓ | Manual | ✗ |
| Deploy | ✓ | ✓ | Manual | ✗ |
| Code Export | ✓ | ✓ | ✓ | ✓ |
| Custom Domain | ✓ | ✓ | Via host | ✗ |
| Templates | ✓ | ✓ | Limited | ✓ |
| Version History | ✓ | ✓ | Git | ✗ |
## Pricing Comparison
| Platform | Free Tier | Paid Plans |
| ----------- | ------------- | --------------------------------------- |
| **Kleap** | 5 credits/day | [See pricing](https://kleap.co/pricing) |
| **Lovable** | Limited | \$20+/mo |
| **Bolt** | Limited | \$20+/mo |
| **v0** | Limited | Usage-based |
| **Webflow** | Limited | \$14-39/mo |
| **Bubble** | Limited | \$29-119/mo |
*Prices may change. Check official sites for current pricing.*
## Migration
### From Lovable
* Export code to GitHub
* Create new Kleap app from template
* Rebuild features (AI makes this fast)
* [Migration Guide](/tips/migration-guide)
### From Bolt
* Download your code
* Adapt for Astro structure
* Import into Kleap or rebuild
### To Traditional Development
* Push to GitHub
* Clone locally
* Continue development with any IDE
* All standard Astro patterns work
Try Kleap and see for yourself
# Glossary
Source: https://docs.kleap.co/reference/glossary
Definitions of common terms
Quick reference for terms used in Kleap and web development.
## A
### API (Application Programming Interface)
A way for different software applications to communicate. Kleap sites are static-first; server-side logic and data are handled by the built-in Kleap Database when you need them.
### API Route
A server-side endpoint that handles HTTP requests (a common pattern in traditional web frameworks). Kleap sites are static — use the built-in Kleap Database for dynamic behavior instead.
### app\_files
Kleap's managed store and source of truth for every file in your site. Kleap versions your files for you — there's no repo, sandbox, or local checkout to manage.
### Astro
The web framework Kleap builds with. Astro 5 produces fast, static-first sites (Tailwind CSS v4, TypeScript) and hydrates interactive React "islands" only where needed.
### Authentication
The process of verifying a user's identity, typically through login with email/password or OAuth.
### Authorization
Determining what an authenticated user is allowed to do. Different from authentication.
## B
### Build
The process of compiling your app into optimized files for production deployment.
### Bundle
The compiled JavaScript files that are sent to the browser.
## C
### CDN (Content Delivery Network)
A network of servers distributed globally that serves your content from the nearest location to users.
### Client Component
A React component that runs in the browser. In Astro, add a `client:*` directive (e.g. `client:load`, `client:visible`) to hydrate it as an island.
### CORS (Cross-Origin Resource Sharing)
Security mechanism that controls which domains can access your API.
### Credit
The unit of usage in Kleap. Each AI interaction consumes credits based on complexity.
### CRUD
Create, Read, Update, Delete - the four basic database operations.
## D
### Deployment
The process of publishing your app to make it accessible on the internet.
### DNS (Domain Name System)
The system that translates domain names (example.com) to IP addresses.
### DOM (Document Object Model)
The programming interface for HTML documents that allows JavaScript to manipulate page content.
## E
### Edge Function
Serverless functions that run at the edge (close to users) for faster response times.
### Environment Variable
A variable set outside your code that configures behavior (like API keys).
## F
### Favicon
The small icon that appears in browser tabs for your website.
### Framework
A pre-built structure that provides common functionality. Kleap builds sites with Astro.
### Frontend
The client-side part of an application that users interact with directly.
## G
### Git
Version control system for tracking code changes.
### GitHub
A platform for hosting Git repositories and collaborating on code.
## H
### Hook
In React, functions that let you use state and other features in functional components (useState, useEffect, etc.).
### Hot Reload
Automatic browser refresh when you make code changes during development.
### HTTPS
Secure version of HTTP that encrypts data in transit.
### Hydration
The process where React takes over server-rendered HTML and makes it interactive.
## I
### IDE (Integrated Development Environment)
A software application for writing code. Kleap has a built-in code editor.
### Island
An interactive component (such as a React island) hydrated on an otherwise static Astro page. Only islands ship JavaScript, keeping pages fast.
## J
### JSX
JavaScript XML - syntax extension that lets you write HTML-like code in JavaScript.
### JWT (JSON Web Token)
A secure way to transmit information between parties, commonly used for authentication.
## K
### Kleap
AI-powered platform for building Astro websites using natural language.
### Kleap Database
Kleap's optional built-in database: a managed database that keeps each user's data private, with built-in email/password accounts. Enable it on demand — there's no external database to connect.
## L
### Lazy Loading
Technique of loading content only when needed, improving initial load time.
### Layout
A component that wraps pages to share common structure (header, footer, meta). Astro sites use layout components for this.
## M
### Metadata
Data about your page (title, description) used by search engines and social media.
### Migration
A database change script that modifies the schema.
### Middleware
Code that runs between a request and response, often for auth or redirects.
## N
### Node.js
JavaScript runtime that allows JavaScript to run on servers.
### NPM (Node Package Manager)
Tool for installing and managing JavaScript packages.
## O
### OAuth
Standard for authorization that allows users to grant access without sharing passwords.
### OG (Open Graph)
Protocol for controlling how your content appears when shared on social media.
## P
### Preview
The live view of your site while you build in Kleap — a real, ephemeral Astro build rendered in the editor.
### Production
The live version of your app that real users access.
### Props
Properties passed to React components.
### PWA (Progressive Web App)
A web app that can be installed on devices and work offline.
## R
### React
JavaScript library for building user interfaces. In Kleap, React powers interactive islands on Astro pages.
### Responsive Design
Design approach that adapts to different screen sizes.
### REST (Representational State Transfer)
Architectural style for designing networked applications.
### Route
A URL path that maps to a specific page or API endpoint.
## S
### SaaS (Software as a Service)
Software delivered over the internet on a subscription basis.
### Sandbox
An isolated environment for running code. Kleap previews Astro sites with an ephemeral in-editor build, so there's no persistent sandbox to manage.
### Schema
The structure of your database (tables, columns, relationships).
### SEO (Search Engine Optimization)
Practices to improve your site's visibility in search results.
### Server Component
A React component that renders on the server (a concept in some frameworks). Kleap sites are static Astro, rendered ahead of time.
### Serverless
Computing model where the cloud provider manages servers automatically.
### SSR (Server-Side Rendering)
Rendering pages on the server before sending to the browser.
### State
Data that determines a component's behavior and rendering.
## T
### Tailwind CSS
Utility-first CSS framework. Kleap styles Astro sites with Tailwind CSS v4.
### Template
Pre-built starting point for creating new apps.
### TypeScript
JavaScript with static type checking, used by Kleap apps.
## U
### UI (User Interface)
The visual elements users interact with.
### URL (Uniform Resource Locator)
Web address that points to a specific resource.
### UX (User Experience)
The overall experience a user has with your application.
## V
### Version Control
System for tracking changes to code over time (like Git).
### Version History
Record of changes made to your app over time.
## W
### Webhook
HTTP callback that sends data when an event occurs.
### WebSocket
Protocol for real-time, two-way communication between client and server.
## Need More Terms?
Missing a definition? Let us know on Discord or email [hello@kleap.co](mailto:hello@kleap.co).
# Keyboard Shortcuts
Source: https://docs.kleap.co/reference/keyboard-shortcuts
Navigate Kleap faster with keyboard shortcuts
Speed up your workflow with these keyboard shortcuts.
## General
| Action | Mac | Windows/Linux |
| ---------------------- | ----- | ------------- |
| Search/Command palette | `⌘ K` | `Ctrl K` |
| Settings | `⌘ ,` | `Ctrl ,` |
| Help | `⌘ ?` | `Ctrl ?` |
## Chat
| Action | Mac | Windows/Linux |
| ------------------- | ------------- | ------------- |
| Focus chat input | `⌘ L` | `Ctrl L` |
| Send message | `Enter` | `Enter` |
| New line in message | `Shift Enter` | `Shift Enter` |
| Stop generation | `Escape` | `Escape` |
## Editor
| Action | Mac | Windows/Linux |
| ---------------------- | ----------- | -------------- |
| Save file | `⌘ S` | `Ctrl S` |
| Undo | `⌘ Z` | `Ctrl Z` |
| Redo | `⌘ Shift Z` | `Ctrl Shift Z` |
| Find | `⌘ F` | `Ctrl F` |
| Find and replace | `⌘ H` | `Ctrl H` |
| Go to line | `⌘ G` | `Ctrl G` |
| Toggle comment | `⌘ /` | `Ctrl /` |
| Duplicate line | `⌘ Shift D` | `Ctrl Shift D` |
| Move line up | `Option ↑` | `Alt ↑` |
| Move line down | `Option ↓` | `Alt ↓` |
| Select word | `⌘ D` | `Ctrl D` |
| Select all occurrences | `⌘ Shift L` | `Ctrl Shift L` |
## File Navigation
| Action | Mac | Windows/Linux |
| -------------- | ------- | ------------- |
| Open file | `⌘ P` | `Ctrl P` |
| Close file | `⌘ W` | `Ctrl W` |
| Switch file | `⌘ Tab` | `Ctrl Tab` |
| Toggle sidebar | `⌘ B` | `Ctrl B` |
## Preview
| Action | Mac | Windows/Linux |
| ------------------ | ----------- | -------------- |
| Refresh preview | `⌘ R` | `Ctrl R` |
| Hard refresh | `⌘ Shift R` | `Ctrl Shift R` |
| Toggle device mode | `⌘ D` | `Ctrl D` |
## Version History
| Action | Mac | Windows/Linux |
| ---------------- | ----------- | -------------- |
| Open history | `⌘ Shift H` | `Ctrl Shift H` |
| Undo last change | `⌘ Z` | `Ctrl Z` |
## Publishing
| Action | Mac | Windows/Linux |
| ------- | ----------- | -------------- |
| Publish | `⌘ Shift P` | `Ctrl Shift P` |
## Selection
| Action | Mac | Windows/Linux |
| ---------- | ----- | ------------- |
| Select all | `⌘ A` | `Ctrl A` |
| Copy | `⌘ C` | `Ctrl C` |
| Cut | `⌘ X` | `Ctrl X` |
| Paste | `⌘ V` | `Ctrl V` |
## Text Editing
| Action | Mac | Windows/Linux |
| ------------------- | ------------------ | ---------------- |
| Delete word | `Option Backspace` | `Ctrl Backspace` |
| Delete line | `⌘ Shift K` | `Ctrl Shift K` |
| Go to start of line | `⌘ ←` | `Home` |
| Go to end of line | `⌘ →` | `End` |
| Go to start of file | `⌘ ↑` | `Ctrl Home` |
| Go to end of file | `⌘ ↓` | `Ctrl End` |
## Multi-Cursor
| Action | Mac | Windows/Linux |
| ------------------- | -------------- | ------------- |
| Add cursor above | `⌘ Option ↑` | `Ctrl Alt ↑` |
| Add cursor below | `⌘ Option ↓` | `Ctrl Alt ↓` |
| Add cursor at click | `Option Click` | `Alt Click` |
## Code Folding
| Action | Mac | Windows/Linux |
| ---------- | ------------ | --------------- |
| Fold | `⌘ Option [` | `Ctrl Shift [` |
| Unfold | `⌘ Option ]` | `Ctrl Shift ]` |
| Fold all | `⌘ K ⌘ 0` | `Ctrl K Ctrl 0` |
| Unfold all | `⌘ K ⌘ J` | `Ctrl K Ctrl J` |
## Tips
Don't try to memorize all shortcuts at once. Pick 2-3 that would help your workflow and focus on those.
Start with these:
* `⌘ K` - Command palette
* `⌘ P` - Open file
* `⌘ /` - Toggle comment
* `⌘ D` - Select word/next occurrence
When typing in the preview (forms), editor shortcuts are disabled to avoid conflicts.
## Customization
Currently, keyboard shortcuts cannot be customized. We're considering this for a future update.
Learn more about the editor
# Limits & Quotas
Source: https://docs.kleap.co/reference/limits
Platform limits and quotas
Understanding the limits of Kleap and integrated services.
## Kleap Limits
### Plans & Credits
| Plan | Daily Free Credits | Monthly AI Credits |
| --------------------------- | ------------------ | ---------------------- |
| **Free** | 5 per day | — |
| **Launch** (\$9/mo) | 5 per day | Hosting only |
| **Pro** (from \$25/mo) | 5 per day | From 100/mo (scalable) |
| **Business** (from \$50/mo) | 5 per day | From 100/mo (scalable) |
| **Enterprise** | 5 per day | Custom |
See [Plans & Credits](/introduction/plans-and-credits) and [kleap.co/pricing](https://kleap.co/pricing) for live numbers.
### How Daily Claims Work
* Claim once every 24 hours
* Each claim adds 5 credits to your balance
* Paid monthly credits roll over and never expire
* Free users can claim up to 30 times per month
### Published Web Projects
* Publishing availability and published-project allowances depend on your plan
* Eligible plans can publish to a `kleap.io` subdomain
* Custom-domain access and allowances are listed on the pricing page
Publishing does not consume AI credits. Hosting availability and limits are plan-specific; see [pricing](https://kleap.co/pricing).
### Team Members
Team seats scale by plan (Business and above include more). See [pricing](https://kleap.co/pricing).
### Collaboration
* **Invitation expiration**: 7 days
* **Rate limit**: Max 5 invitations per hour
* **Roles**: Owner, Editor, Viewer
## Preview
While you build, Kleap shows a live preview of your site. The preview is a **real, ephemeral Astro build** rendered inside the editor — there's no persistent sandbox or dev server to manage.
* Rebuilds on demand as you and the AI make changes
* No auto-stop, restart, or sandbox resource limits to worry about
* Your files are stored and versioned for you in Kleap (`app_files`), so nothing is lost between sessions
When you publish, your site goes live at `https://{app}.kleap.io` on Kleap's global edge network, with free automatic SSL.
## Kleap Hosting (Production)
Published Kleap sites are static Astro sites served from Kleap's global edge network. Publishing is deliberate: click **Publish** or **Update** when you want a reviewed version to go live.
| Aspect | Detail |
| -------------- | --------------------------------------------- |
| Hosting | Kleap's global edge (global CDN) |
| SSL | Free, automatic |
| Published URL | `https://{app}.kleap.io` |
| Custom domains | Supported (A record → `178.104.71.55`) |
| Deployments | Plan-specific; started with Publish or Update |
Dynamic features — accounts, saved data, and forms — are handled by the built-in Kleap Database and KleapForm when you enable them. Plan-specific hosting and usage allowances are listed on [pricing](https://kleap.co/pricing).
## Kleap Database
Kleap sites are static by default. When you need accounts or saved data, enable the built-in **Kleap Database** on demand — a managed database that keeps each user's data private, with built-in email/password accounts. There's no external database to connect.
| Feature | Detail |
| ------------ | ---------------------------------- |
| Type | Managed built-in database |
| Security | Each user only sees their own data |
| Accounts | Built-in email/password |
| Availability | Opt-in / on demand |
Storage, bandwidth, and usage allowances depend on your plan — see [pricing](https://kleap.co/pricing).
## File Limits
### Kleap Editor
| Type | Limit |
| ------------- | ------------------------ |
| File Size | 10 MB |
| Files per App | No hard limit |
| Image Formats | JPG, PNG, GIF, WebP, SVG |
| Video Formats | MP4, WebM |
## API Rate Limits
When you enable the Kleap Database, its data API and built-in authentication enforce standard rate limits to keep sites responsive. Exact limits depend on your plan — see [pricing](https://kleap.co/pricing).
## Hitting Limits
### What Happens
* **Credits exhausted**: Can't make AI changes until next claim or upgrade
* **App limit reached**: Can't publish new apps until you upgrade
* **Hosting limits**: Deployment may fail or traffic throttled
* **Kleap Database limits**: Database operations may be throttled
### Solutions
1. **Claim daily credits** - Free users can claim 5 credits every 24 hours
2. **Upgrade plan** - More credits and higher limits
3. **Wait for reset** - Some limits reset monthly
4. **Optimize usage** - Write efficient queries, compress images
## Monitoring Usage
### Kleap
* View credit balance in dashboard
* Check published app count in Settings
* Monitor bandwidth in app settings
### Kleap Database
* Database size and usage appear in your Kleap dashboard when the database is enabled
Compare plans and understand credits
# Best Practices
Source: https://docs.kleap.co/tips/best-practices
Guidelines for building successful apps with Kleap
Follow these guidelines to build better apps faster.
## Planning Your App
### Start with a Clear Vision
Before opening Kleap:
1. **Define your goal** - What problem does this app solve?
2. **List core features** - What must it do? (Start with 3-5)
3. **Sketch the flow** - How will users navigate?
4. **Identify data** - What information needs storing?
### Choose the Right Template
Templates give you a head start:
* **SaaS Template** - User auth, dashboard, billing
* **Portfolio** - Personal sites, portfolios
* **Landing Page** - Marketing, product launches
* **E-commerce** - Product sales, checkout
Or start blank if you have a unique idea.
## Building Incrementally
### Small Steps Win
Build one feature at a time, test it, then add the next
Try to build everything at once in one long prompt
### Recommended Build Order
Header, footer, navigation structure
Create main pages with placeholder content
Build reusable components (cards, forms, etc.)
Refine colors, typography, spacing
Add real content; enable Kleap Database if you need saved data or logins
Add interactions, forms, features
Responsive fixes, loading states, error handling
## Code Organization
### Let AI Follow Conventions
Kleap uses a standard Astro project structure:
```
src/pages/ → Pages and routes (.astro files)
src/components/ → Reusable components (.astro and .tsx)
src/layouts/ → Shared page layouts (Base.astro)
src/styles/ → global.css and styles
public/ → Static assets (images, fonts)
```
Don't fight this structure. Let AI organize code appropriately.
### Component Reusability
Ask for reusable components:
```
"Create a Card component that I can reuse across different
sections with customizable title, description, and icon"
```
Then reference them:
```
"Use the Card component to display the pricing tiers"
```
## Styling Guidelines
### Consistent Design
Establish design tokens early:
```
"Use these colors throughout the app:
- Primary: blue-600
- Secondary: gray-600
- Background: gray-50
- Accent: purple-500"
```
### Mobile First
Always consider mobile:
```
"Make sure this section works well on mobile devices,
with stacked layout and appropriate text sizes"
```
## Database Best Practices
### Plan Your Schema
Before asking AI to create tables:
1. List what data you need
2. Define relationships
3. Consider what queries you'll run
### Enable Security
Always ask for per-user data access:
```
"Create a posts table and scope it so users can only
see and edit their own posts"
```
## Performance Tips
### Optimize Images
Kleap optimizes images for you — just use normal `` tags or Astro's
asset handling. There's no `next/image` component.
```
"Add these images with appropriate sizes, alt text,
and lazy loading"
```
### Keep It Static
Astro renders static HTML by default. Only add interactivity where you
actually need it, using React islands.
```
"Make this section a static component, and only make the
image carousel interactive"
```
### Add Loading States
```
"Add a loading skeleton while the data is being fetched"
```
## Testing Your App
### Test as You Build
After each change:
1. Check the preview
2. Test on mobile view
3. Click through the flow
4. Look for errors in console
### Test Edge Cases
* Empty states (no data)
* Error states (failed requests)
* Loading states
* Long content
* Many items
## Before Publishing
### Checklist
* [ ] All pages load without errors
* [ ] Forms work and validate
* [ ] Mobile layout looks good
* [ ] Links and buttons work
* [ ] Images load properly
* [ ] Auth flow works (if applicable)
* [ ] Database queries work
* [ ] Environment variables set
### Configuration & Secrets
Kleap sites are static, so any value baked into the site is public. Use Astro build-time config for **non-secret** values only:
```
"Move the public API base URL to a PUBLIC_ environment
variable and read it with import.meta.env.PUBLIC_API_URL"
```
Never put a real secret (a private API key, token, or password) in a static site — it ships to the browser. Secrets belong in an external backend or serverless function. For payments use Stripe payment links (publishable key only); for form emails use built-in Forms.
## Common Mistakes to Avoid
Break large features into smaller prompts. Test after each change.
Always test mobile view. Many users browse on phones.
Use database or props instead of hardcoded content for dynamic data.
Always handle what happens when things fail (no data, API errors).
Templates save hours of work. Start with one when possible.
## Getting Help
When stuck:
1. **Check the docs** - Answer might be here
2. **Ask AI to explain** - "Why isn't this working?"
3. **Use version history** - Roll back if needed
4. **Join Discord** - Community can help
Solutions to common problems
# Custom Fonts
Source: https://docs.kleap.co/tips/custom-fonts
Add custom typography to your app
Customize your app's typography with custom fonts.
## Google Fonts
The easiest way to add fonts:
```
"Change the heading font to Inter and body font to Roboto
using Google Fonts"
```
### Implementation
Add the Google Fonts `` tags in the `
` of your base layout:
```astro theme={null}
---
// src/layouts/Base.astro
---
```
### Using in Tailwind
Map the fonts to Tailwind font families so you can use utility classes:
```css theme={null}
/* src/styles/global.css */
@theme {
--font-sans: "Inter", system-ui, sans-serif;
--font-heading: "Roboto", system-ui, sans-serif;
}
```
Then use in components:
```astro theme={null}
Heading
Body text
```
## Popular Font Combinations
### Modern & Clean
```
Headings: Inter
Body: Inter
```
### Professional
```
Headings: Poppins
Body: Open Sans
```
### Creative
```
Headings: Playfair Display
Body: Lato
```
### Tech/Startup
```
Headings: Space Grotesk
Body: DM Sans
```
## Local Fonts
For fonts not on Google Fonts:
### Add Font Files
Place in `public/fonts/`:
```
public/
fonts/
MyFont-Regular.woff2
MyFont-Bold.woff2
```
### Configure
Declare the font with `@font-face` in your global stylesheet, pointing at the
files in `public/` (served from the site root):
```css theme={null}
/* src/styles/global.css */
@font-face {
font-family: "MyFont";
src: url("/fonts/MyFont-Regular.woff2") format("woff2");
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "MyFont";
src: url("/fonts/MyFont-Bold.woff2") format("woff2");
font-weight: 700;
font-style: normal;
font-display: swap;
}
@theme {
--font-brand: "MyFont", system-ui, sans-serif;
}
```
Then use `class="font-brand"` on your headings or body text.
## Font Weights
Common weight names:
| Weight | Name |
| ------ | ----------- |
| 100 | Thin |
| 200 | Extra Light |
| 300 | Light |
| 400 | Regular |
| 500 | Medium |
| 600 | Semi Bold |
| 700 | Bold |
| 800 | Extra Bold |
| 900 | Black |
### Loading Specific Weights
Only load what you need for better performance. Request just those weights in
your Google Fonts `` URL:
```
https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap
```
## Font Performance
### Optimization Tips
1. **Load only needed weights** - Don't load all weights
2. **Limit font families** - 2-3 max
3. **Use font-display: swap** - Shows fallback while loading
4. **Subset fonts** - Only latin if that's all you need
### Reduce Layout Shift
To keep fonts fast and avoid layout shift:
* **Self-host** the `.woff2` files in `public/fonts/` (no external request) when
you want zero third-party calls
* **Preconnect / preload** the font in your base layout's ``
* **Use `font-display: swap`** so text shows in a fallback while the font loads
* **Set a matching fallback** font family so the swap is barely noticeable
## Typography Scale
### Consistent Sizing
Use Tailwind's typography scale:
| Class | Size |
| ----------- | ---- |
| `text-xs` | 12px |
| `text-sm` | 14px |
| `text-base` | 16px |
| `text-lg` | 18px |
| `text-xl` | 20px |
| `text-2xl` | 24px |
| `text-3xl` | 30px |
| `text-4xl` | 36px |
| `text-5xl` | 48px |
### Custom Scale
```css theme={null}
/* src/styles/global.css */
@theme {
--text-hero: 4.5rem;
--text-hero--line-height: 1.1;
--text-subtitle: 1.25rem;
--text-subtitle--line-height: 1.6;
}
```
## Line Height & Spacing
### Line Height
```astro theme={null}
Comfortable reading
Compact text
```
### Letter Spacing
```astro theme={null}
Tight headings
Labels
```
## Common Font Tasks
### Change All Fonts
```
"Change the app's primary font to Poppins for headings
and Inter for body text"
```
### Consistent Typography
```
"Create a consistent typography system with h1-h6 styles,
body text, and small text"
```
### Brand Font
```
"I have a brand font file (BrandFont.woff2). Add it as
the primary heading font."
```
## Font Fallbacks
Always specify fallbacks in your Tailwind theme:
```css theme={null}
/* src/styles/global.css */
@theme {
--font-sans: "Inter", system-ui, sans-serif;
--font-serif: Georgia, serif;
--font-mono: "Fira Code", monospace;
}
```
## Variable Fonts
Modern fonts with adjustable properties. Load the single variable `.woff2` and
declare a weight range with `@font-face`:
```css theme={null}
/* src/styles/global.css */
@font-face {
font-family: "Inter";
src: url("/fonts/Inter-Variable.woff2") format("woff2");
font-weight: 100 900; /* full range in one file */
font-display: swap;
}
```
Benefits:
* Smaller file size
* All weights in one file
* Smooth weight transitions
## Troubleshooting
* Check font name spelling (must match the `@font-face`/`` exactly)
* Verify the weight exists for that font
* Check the browser console for errors
* Ensure the `` is in the base layout ``, or the font file exists in `public/fonts/`
* Make sure `font-display: swap` is set (in the Google Fonts URL or your `@font-face`)
* Preconnect/preload the font in the base layout ``
* Set a matching fallback font family so the swap is barely noticeable
* Verify you loaded the correct weight
* Check CSS isn't overriding font settings
* Ensure the Tailwind font family (e.g. `font-heading`) is applied to your element
More design tips
# Email Integration
Source: https://docs.kleap.co/tips/email-integration
Send emails from your app
Kleap builds **Astro static sites**, so there are two very different email needs, and they work in very different ways:
* **Form notifications** — built in. When someone submits a KleapForm, you (and optionally the respondent) get emailed automatically. No external service, no setup.
* **Custom / transactional email** — sending your own emails (welcome, password reset, order confirmation, newsletters). A static site has no server to send these, so it requires an external email provider called from a backend or serverless function. This is an advanced setup, not a one-click toggle.
## Form Notifications (Built In)
The simplest way to "get an email when something happens" is a **KleapForm**. Every form submission is:
* Stored in your dashboard (Forms → responses)
* Emailed to the site owner automatically
On the **Pro** plan you also get:
* **Respondent auto-reply** — automatically send a confirmation email back to the person who submitted the form
* **Webhooks** — POST each submission to any external URL (Zapier, Make, your own endpoint) to trigger further automation
Just ask the AI:
```
"Add a contact form that emails me when someone submits"
```
This covers most "email on submission" use cases — contact forms, lead capture, booking requests — with zero configuration.
## Custom / Transactional Email (Advanced)
If you need to send your own emails — welcome emails, password resets, order confirmations, newsletters — you need an external email provider. Because a Kleap site is **static** (no server runtime), the email-sending code has to run on a backend or serverless function you host separately, and your site calls it.
Be realistic: this is a developer task, not a setting inside Kleap.
### Email Services
You'll use an external email service to do the actual sending. When choosing one, compare on:
| Consideration | What to look for |
| ------------------------ | ----------------------------------------------- |
| **Developer experience** | A simple API and clear docs |
| **Deliverability** | A strong transactional-email reputation |
| **Volume & pricing** | A free tier and rates that fit your send volume |
| **Domain setup** | Support for SPF, DKIM, and DMARC verification |
### How It Works
1. Sign up with an external email service and get an API key.
2. Deploy a small serverless function (Cloudflare Worker, Vercel/Netlify function, etc.) that calls the provider's API. Your API key stays on the server — never ship it in the static site, where it would be publicly visible.
3. Call that function from your site (for example, from a form handler).
### Example Serverless Function
```typescript theme={null}
// A serverless function you host separately (e.g. Cloudflare Worker /
// Vercel / Netlify function) — NOT part of the static Astro site.
// It calls your chosen email service's HTTP API. The API key stays
// here on the server, never in the static site.
export async function POST(request: Request) {
const { to, subject, html } = await request.json();
const res = await fetch('https://api.your-email-service.com/emails', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.EMAIL_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ from: 'hello@yourdomain.com', to, subject, html }),
});
if (!res.ok) {
return Response.json({ error: await res.text() }, { status: 500 });
}
return Response.json(await res.json());
}
```
### Verify Your Domain
For custom from addresses (`hello@yourdomain.com`), verify your domain with the provider and set up SPF, DKIM, and DMARC records. This is what keeps your email out of the spam folder.
## Common Email Types
Example prompts once you have an email backend wired up:
### Welcome Email
```
"Send a welcome email when a user signs up with their name
and a link to get started"
```
### Password Reset
```
"Add forgot password functionality that sends a reset link via email"
```
### Order Confirmation
```
"Send an order confirmation email with order details when a
purchase is completed"
```
### Newsletter
```
"Add newsletter signup that stores emails in Kleap Database
and can send bulk emails"
```
## Email Templates
### HTML Email
```typescript theme={null}
const emailHtml = `
`;
```
### React Email Templates
For complex emails, use React Email:
```
"Install @react-email/components and create a reusable
welcome email template"
```
```typescript theme={null}
import { Html, Button, Text } from '@react-email/components';
export function WelcomeEmail({ name, dashboardUrl }) {
return (
Welcome, {name}!
);
}
```
## Email Best Practices
### Avoid Spam Filters
Set up SPF, DKIM, and DMARC
Use recognizable sender name
Avoid spam trigger words
Required for marketing emails
### Rate Limiting
Don't send too many emails too fast:
```typescript theme={null}
// Simple rate limiting
const lastSent = await getLastEmailTime(userId);
if (Date.now() - lastSent < 60000) {
throw new Error('Please wait before sending another email');
}
```
### Error Handling
```typescript theme={null}
try {
await sendEmail({ to, subject, html });
} catch (error) {
console.error('Email failed:', error);
// Log to database for retry
await logFailedEmail({ to, subject, error });
}
```
## Email with Queues
For high-volume or reliable email, queue messages instead of sending them inline.
### Queue Emails in Database
Store pending emails in **Kleap Database**:
```sql theme={null}
CREATE TABLE email_queue (
id uuid PRIMARY KEY,
to_email text,
subject text,
html text,
status text DEFAULT 'pending',
created_at timestamptz DEFAULT now()
);
```
Then process the queue from your serverless backend on a schedule (a cron job or scheduled function), sending each pending row and marking it sent.
## Testing Emails
### Development
Use your email service's test or sandbox mode, or a dedicated email-testing
tool that captures messages instead of delivering them (many provide a fake
SMTP inbox for local testing).
### Check Rendering
Preview how your email looks across different email clients with an
email-rendering tool before sending to real recipients.
## Troubleshooting
* Check API key is correct
* Verify it's set on your serverless backend
* Check the provider's dashboard for errors
* Verify from address is authorized
* Set up domain verification (SPF, DKIM, DMARC)
* Check email content for spam triggers
* Use a reputable email service
* Add proper unsubscribe link
* Check your service's rate limits
* Implement queuing for bulk sends
* Upgrade plan if needed
Store form responses, subscribers, and email logs
# Error Reference
Source: https://docs.kleap.co/tips/error-reference
Common error messages and how to fix them
A guide to common error messages and their solutions.
## Build Errors
### Module not found
```
Error: Cannot find module '@/components/Button'
```
**Cause**: The imported file doesn't exist or path is wrong.
**Fix**:
```
The import '@/components/Button' can't be found.
Can you check if the file exists and fix the import path?
```
***
### Unexpected token
```
SyntaxError: Unexpected token '<'
```
**Cause**: JavaScript syntax error, often in JSX.
**Fix**:
```
Getting a syntax error "Unexpected token".
Can you find and fix the syntax issue?
```
***
### Type error
```
Type 'string' is not assignable to type 'number'
```
**Cause**: TypeScript type mismatch.
**Fix**:
```
Getting this type error: [full error message]
Can you fix the type issue?
```
***
### Export not found
```
Attempted import error: 'Button' is not exported from './components'
```
**Cause**: Component exists but isn't exported.
**Fix**:
```
The 'Button' component isn't exported properly.
Can you add the export to the component file?
```
## Runtime Errors
### Cannot read properties of undefined
```
TypeError: Cannot read properties of undefined (reading 'map')
```
**Cause**: Trying to use a method on undefined/null value.
**Fix**:
```
Getting "Cannot read properties of undefined" when mapping over data.
Can you add a check for undefined and handle the empty state?
```
***
### X is not a function
```
TypeError: response.json is not a function
```
**Cause**: Variable isn't what you expect.
**Fix**:
```
Getting "[x] is not a function" error.
Can you check the variable type and fix the function call?
```
***
### Network error
```
TypeError: Failed to fetch
```
**Cause**: API request failed (network, CORS, or server error).
**Fix**:
```
API fetch is failing with a network error.
Can you check the API endpoint and error handling?
```
## React Island Errors
These happen inside interactive React components (islands) on your Astro site.
### Hydration mismatch
```
Hydration failed because the initial UI does not match what was rendered on the server
```
**Cause**: The static HTML and the hydrated island render different content.
**Fix**:
```
Getting a hydration mismatch error.
Can you fix the component to render the same on server and client?
```
Common causes:
* Using `Date.now()` or `Math.random()` directly
* Accessing `window` or `localStorage` without checks
* Conditional rendering based on browser-only values
***
### Invalid hook call
```
Invalid hook call. Hooks can only be called inside of the body of a function component
```
**Cause**: Hook used incorrectly.
**Fix**:
```
Getting "Invalid hook call" error.
Can you check that hooks are only used in function components and not inside conditions or loops?
```
***
### Too many re-renders
```
Error: Too many re-renders. React limits the number of renders
```
**Cause**: Component is in infinite render loop.
**Fix**:
```
Getting "Too many re-renders" error.
Can you find and fix the infinite loop in the component?
```
Usually caused by:
* Calling `setState` directly in render
* Missing dependency array in `useEffect`
* State update triggering another state update
## Database Errors
### Permission denied on a row
```
This action isn't allowed for the current user on table "posts"
```
**Cause**: Data is scoped per user, and this operation isn't permitted for the signed-in user.
**Fix**:
```
Getting a permission error when [inserting/updating/deleting] data.
Can you check that the data rules let the right users read and write this table?
```
***
### Foreign key violation
```
insert or update on table "posts" violates foreign key constraint
```
**Cause**: Referenced record doesn't exist.
**Fix**:
```
Getting foreign key violation error.
The referenced [table] record doesn't exist.
Can you fix the query or create the referenced record first?
```
***
### Duplicate key
```
duplicate key value violates unique constraint
```
**Cause**: Trying to insert duplicate value in unique column.
**Fix**:
```
Getting duplicate key error.
Can you add a check for existing records or use upsert?
```
## Authentication Errors
### Session not found
```
Auth session missing — no signed-in user
```
**Cause**: User not logged in or session expired.
**Fix**:
```
Getting "session missing" error.
Can you add authentication check and redirect to login if not authenticated?
```
***
### Invalid login credentials
```
Invalid login credentials
```
**Cause**: Wrong email or password.
**Fix**: This is expected for wrong credentials. Ensure your error handling shows a user-friendly message.
## Environment Variable Errors
### Missing environment variable
```
Error: Missing environment variable: PUBLIC_API_URL
```
**Cause**: Required variable not set. (In Astro, browser-exposed variables are
prefixed with `PUBLIC_`.)
**Fix**:
1. Go to Settings > Environment
2. Add the missing variable
3. Redeploy if in production
## Quick Reference Table
| Error Contains | Likely Cause | Quick Fix |
| --------------------- | ---------------------- | ------------------------ |
| `Cannot find module` | Wrong import | Check file path |
| `undefined` | Missing data | Add null check |
| `not a function` | Wrong variable type | Check variable |
| `Hydration` | Server/client mismatch | Fix SSR |
| `Invalid hook` | Hook misuse | Check hook rules |
| `Too many re-renders` | Infinite loop | Fix useEffect/setState |
| `not allowed` | Per-user data rule | Check table access rules |
| `Failed to fetch` | Network/API issue | Check endpoint |
| `PUBLIC_` | Env var missing | Add to settings |
## Getting More Help
If an error isn't listed here:
1. **Copy the full error message**
2. **Paste it to Kleap AI** with context about what you were doing
3. **Check browser console** for additional details
Step-by-step solutions to common problems
# From Idea to App
Source: https://docs.kleap.co/tips/from-idea-to-app
Complete guide to building an app from scratch
A step-by-step guide to taking your idea from concept to launched product.
## Phase 1: Planning
### Define Your Goal
Before opening Kleap, answer:
1. **What problem does this solve?**
2. **Who is it for?**
3. **What are the must-have features?**
4. **What can wait for later?**
### Feature Prioritization
Use the MoSCoW method:
| Priority | Features |
| --------------- | ------------------------------------- |
| **Must Have** | Core functionality that makes it work |
| **Should Have** | Important but not essential at launch |
| **Could Have** | Nice to have if time permits |
| **Won't Have** | Save for future versions |
### Example: Task Manager App
| Priority | Features |
| --------------- | ----------------------------------- |
| **Must Have** | Create tasks, mark complete, delete |
| **Should Have** | Due dates, categories |
| **Could Have** | Reminders, sharing |
| **Won't Have** | Mobile app, integrations |
## Phase 2: Setup
### Choose Your Starting Point
Start with a template if one matches your idea:
* **SaaS Template** - User auth, dashboard, billing
* **Landing Page** - Marketing sites
* **E-commerce** - Product sales
Start from scratch for unique ideas:
1. Create new app
2. Choose "Blank" template
3. Describe your first page
### Initial Prompt
Start with a high-level description:
```
I'm building a task management app for freelancers.
Create the basic structure with:
- A clean landing page
- Navigation with Home, Features, Pricing, Login
- Footer with links and social icons
```
## Phase 3: Build Core Features
### Work in Layers
Build navigation, footer, page structure
Create main pages with placeholder content
Build reusable UI components
Connect database, define schema
Add interactions, forms, logic
### Example Build Sequence
```
1. "Create a dashboard layout with sidebar navigation"
2. "Add a tasks list component showing task name, due date, and status"
3. "Add a database table for tasks with fields: id, title,
description, due_date, status, user_id"
4. "Connect the tasks list to fetch from the database"
5. "Add a form to create new tasks"
6. "Add the ability to mark tasks as complete"
```
### One Feature at a Time
Don't rush. Complete each feature before moving on:
1. Build it
2. Test it
3. Fix any issues
4. Then move on
## Phase 4: User Authentication
If your app needs users:
```
"Add user authentication with:
- Sign up with email/password
- Login page
- Protect the dashboard route
- Show user's name in the header"
```
### Link Data to Users
Ensure data belongs to users:
```
"Update the tasks table to include user_id and scope it
so users only see their own tasks"
```
## Phase 5: Polish
### Visual Refinement
```
"Improve the overall design:
- Add consistent spacing between sections
- Use a cohesive color palette (blue primary)
- Add hover states to buttons and links
- Ensure good contrast for accessibility"
```
### Responsive Design
```
"Make sure all pages work well on mobile:
- Collapsible navigation
- Stacked layouts on small screens
- Appropriate text sizes"
```
### Loading States
```
"Add loading skeletons while data is being fetched"
```
### Error Handling
```
"Add proper error handling:
- Show error messages if data fails to load
- Validate forms before submission
- Handle network errors gracefully"
```
## Phase 6: Testing
### Manual Testing Checklist
* [ ] All pages load without errors
* [ ] Forms submit correctly
* [ ] Data saves and loads properly
* [ ] Auth flow works (signup → login → logout)
* [ ] Protected routes redirect properly
* [ ] Mobile layout works
* [ ] All buttons/links work
### Test Edge Cases
* Empty states (no data)
* Long content
* Invalid input
* Slow network
* Different browsers
## Phase 7: Launch Prep
### Environment Variables
Ensure all secrets are in environment variables:
```
"Move any hardcoded API keys to environment variables"
```
### SEO
```
"Add SEO metadata to all pages including title,
description, and Open Graph tags"
```
### Analytics
```
"Add analytics to track page views"
```
## Phase 8: Launch
### Deploy to Production
1. Click **Publish**
2. Wait for build to complete
3. Test the live site
### Custom Domain (Optional)
1. Add domain in settings
2. Configure DNS
3. Wait for SSL certificate
### Announce Your Launch
* Share on social media
* Post on relevant communities
* Tell your network
## Phase 9: Iterate
### Gather Feedback
* Watch how users interact
* Collect feature requests
* Track errors with monitoring
### Plan Next Features
Go back to your "Should Have" list:
```
"Now add due date reminders that notify users
via email one day before"
```
## Common Mistakes to Avoid
Launch with minimum viable features. You can always add more.
Test thoroughly before launch. First impressions matter.
Many users browse on phones. Always check mobile layout.
Always scope data to the signed-in user so each person sees only their own. One security hole can ruin your app.
## Timeline Expectations
A simple app can go from idea to launch in:
* **Landing page**: 1-2 hours
* **Simple app (no auth)**: 2-4 hours
* **App with auth & database**: 4-8 hours
* **Complex app**: Multiple sessions
Build incrementally. Don't rush.
More tips for successful building
# Migration Guide
Source: https://docs.kleap.co/tips/migration-guide
Moving from Lovable, Bolt, or v0 to Kleap
Coming from another AI app builder? Here's how to get started with Kleap.
Kleap builds **Astro** websites (Astro 5, Tailwind CSS, React islands for
interactivity, TypeScript). You don't hand-migrate code — you describe or
paste your existing site and Kleap rebuilds it as a fast, static Astro site.
## How Migration Works
There's no import tool that lifts another framework's code over verbatim. Instead:
1. **Describe your existing site** to the AI — its pages, sections, and style
2. **Or paste content/screenshots** so the AI can recreate the look and copy
3. **Kleap rebuilds it as an Astro site** you can then refine with chat
4. **Publish** — click Publish when you're ready to deploy to `https://your-app.kleap.io`
You don't connect an external database or "adapt" old code. If you need data,
accounts, or form submissions, Kleap has those built in (see below).
## From Lovable
Lovable and Kleap are similar in concept. Here's what to know:
### What's the Same
* AI-powered chat interface
* Real-time preview
* Built-in data/accounts (no external database to wire up)
* One-click publishing when you decide the site is ready
* Tailwind CSS styling
### Key Differences
| Feature | Lovable | Kleap |
| ------------- | ----------------- | ------------------------------------- |
| **Framework** | Vite + React | Astro 5 (static, React islands) |
| **Styling** | Tailwind | Tailwind CSS |
| **Hosting** | Lovable Cloud | Kleap Hosting (a global edge network) |
| **Database** | External database | Kleap Database (built-in, opt-in) |
| **Pricing** | Message-based | Credit-based |
### Migration Steps
1. **Note your app's pages and features** (export from Lovable if you can)
2. **Create a new Kleap app**
3. **Describe or paste each page** so the AI recreates it in Astro
4. **Add data or accounts** with Kleap Database only if you need them
5. **Publish** — click Publish to deploy to `your-app.kleap.io`
### Lovable → Kleap Concepts
| Lovable | Kleap Equivalent |
| ----------------- | -------------------------- |
| Chat | AI Chat |
| Preview | Live Preview |
| Deploy | Publish when ready |
| External database | Kleap Database |
| Forms | KleapForm (built-in forms) |
## From Bolt.new
Bolt and Kleap both use AI for development.
### Key Differences
| Feature | Bolt | Kleap |
| -------------- | ------------------ | ------------------------------------- |
| **Output** | Various frameworks | Astro static site |
| **Preview** | StackBlitz | In-editor live build |
| **Database** | Manual setup | Kleap Database (built-in) |
| **Deployment** | Netlify/Manual | Kleap Hosting from the Publish action |
### Migration Steps
1. **Note your site structure** — pages, sections, features
2. **Create a Kleap app** — start fresh or from a template
3. **Describe what to build** — tell the AI each page and section
4. **Add data or forms** if you need them (Kleap Database / KleapForm)
5. **Publish** — click Publish when your site is ready
### Reusing Content
If you have content or a component you like from Bolt, describe it or paste it:
```
Here's the hero section from my old site. Recreate something
similar for this page:
[paste the content, copy, or a screenshot]
```
Kleap will rebuild it as Astro — you don't need it to run the original code.
## From v0 (Vercel)
v0 generates UI components. Kleap builds full websites.
### Differences
| Feature | v0 | Kleap |
| ----------------- | ---------- | ------------------------------------- |
| **Output** | Components | Full sites |
| **Data** | No | Kleap Database (built-in) |
| **Accounts** | No | Built-in (opt-in) |
| **Hosting** | Manual | Kleap Hosting from the Publish action |
| **Interactivity** | Limited | React islands |
### Using v0 Designs in Kleap
If you have a v0 component design you like, describe it or paste the markup so
the AI can recreate it as an Astro component or React island:
```
I have this component design from v0.
Can you recreate it as a section on my homepage?
[paste component code or describe it]
```
Or describe what you saw:
```
Create a pricing table with three tiers, similar to v0's
pricing component style with cards and feature lists
```
## From an Existing Website
Already have a live site (WordPress, Webflow, Squarespace, a custom build)?
### How to Migrate
1. **Create a new Kleap app**
2. **Paste your current site's URL, content, or screenshots**
3. **Ask the AI to recreate it** page by page as an Astro site
4. **Refine** colors, copy, and layout with follow-up messages
### Example
```
Recreate my current homepage. It has:
- Logo on the left, nav links in the center, a "Book a call" button on the right
- A hero with a headline, subtext, and two buttons
- A three-column features section
- A testimonials row and a footer
[paste your current copy or a screenshot]
```
## Data, Accounts & Forms
You do **not** connect an external database. Kleap provides these when you need them:
* **Kleap Database** — a built-in, managed database with built-in email/password
user accounts, where each user only sees their own data. It's opt-in and added
on demand, so simple sites stay purely static.
* **KleapForm** — built-in forms. Submissions land in your dashboard's Data
panel and can trigger email notifications, no backend to set up.
* **Payments** — connect Stripe Payment Links or Buy Buttons (publishable key
only) for checkout.
Ask for them in chat, for example:
```
Add a contact form that emails me each submission
```
```
Add a members area with email/password login backed by Kleap Database
```
## Feature Parity Checklist
When migrating, decide which of these your new site needs:
* [ ] All pages and sections
* [ ] Navigation and footer
* [ ] Contact / lead forms (KleapForm)
* [ ] User accounts (Kleap Database) — only if needed
* [ ] Stored data (Kleap Database) — only if needed
* [ ] Payment / checkout (Stripe links)
* [ ] Custom domain
## Tips for Smooth Migration
Kleap doesn't run your old framework's code. It's faster to describe what
you have and let the AI recreate it as Astro.
Before migrating, write down all pages, sections, and integrations. Use this
as a checklist.
Don't try to recreate everything at once. Build the homepage first, then add
pages and sections one at a time.
Keep your old site live until the new one is fully tested and your custom
domain is pointed over.
## Getting Help
Migration questions? We can help:
* **Discord** - Community support and tips
* **Email** - [hello@kleap.co](mailto:hello@kleap.co) for complex migrations
Begin building your Kleap app
# Mobile Apps
Source: https://docs.kleap.co/tips/mobile-apps
Turn your web app into a mobile app
Transform your Kleap web app into a native mobile app using Capacitor.
## What is Capacitor?
Capacitor is a framework that wraps your web app in a native container, allowing it to run as a mobile app on iOS and Android.
Benefits:
* **One codebase** - Your existing Kleap app
* **Native features** - Camera, push notifications, etc.
* **App store distribution** - Publish to App Store and Play Store
## Requirements
To build mobile apps, you'll need:
* **macOS** - Required for iOS builds
* **Xcode** - For iOS (free from App Store)
* **Android Studio** - For Android
* **Your exported code** - From GitHub or ZIP download
## Getting Started
### 1. Export Your App
First, get your code locally:
1. Open **Settings > Project settings > Integrations**
2. Choose **GitHub** and click **Connect**
3. Push to GitHub
4. Clone the repository
```bash theme={null}
git clone https://github.com/you/your-app.git
cd your-app
```
### 2. Install Capacitor
```bash theme={null}
npm install @capacitor/core @capacitor/cli
npx cap init
```
Follow the prompts:
* **App name**: Your app's name
* **App ID**: com.yourcompany.yourapp
### 3. Build Your Web App
```bash theme={null}
npm run build
```
### 4. Add Platforms
```bash theme={null}
npm install @capacitor/ios
npx cap add ios
npm install @capacitor/android
npx cap add android
```
### 5. Sync Changes
After any code changes:
```bash theme={null}
npm run build
npx cap sync
```
## iOS Development
### Open in Xcode
```bash theme={null}
npx cap open ios
```
### Configure
1. Select your team in Xcode
2. Set bundle identifier
3. Configure app icons
### Run on Simulator
1. Select simulator in Xcode
2. Click Run (▶️)
### Run on Device
1. Connect your iPhone
2. Trust the developer certificate
3. Select device and Run
## Android Development
### Open in Android Studio
```bash theme={null}
npx cap open android
```
### Configure
1. Wait for Gradle sync
2. Set application ID in `build.gradle`
3. Configure app icons
### Run on Emulator
1. Create virtual device in AVD Manager
2. Click Run (▶️)
### Run on Device
1. Enable Developer Mode on Android phone
2. Enable USB debugging
3. Connect via USB
4. Select device and Run
## Native Features
### Camera
```bash theme={null}
npm install @capacitor/camera
```
```typescript theme={null}
import { Camera, CameraResultType } from '@capacitor/camera';
const takePhoto = async () => {
const image = await Camera.getPhoto({
quality: 90,
resultType: CameraResultType.Uri,
});
return image.webPath;
};
```
### Push Notifications
```bash theme={null}
npm install @capacitor/push-notifications
```
```typescript theme={null}
import { PushNotifications } from '@capacitor/push-notifications';
// Request permission
await PushNotifications.requestPermissions();
// Register for push
await PushNotifications.register();
// Listen for notifications
PushNotifications.addListener('pushNotificationReceived', notification => {
console.log('Push received:', notification);
});
```
### Geolocation
```bash theme={null}
npm install @capacitor/geolocation
```
```typescript theme={null}
import { Geolocation } from '@capacitor/geolocation';
const getLocation = async () => {
const position = await Geolocation.getCurrentPosition();
return {
lat: position.coords.latitude,
lng: position.coords.longitude,
};
};
```
### Storage
```bash theme={null}
npm install @capacitor/preferences
```
```typescript theme={null}
import { Preferences } from '@capacitor/preferences';
// Save
await Preferences.set({ key: 'user', value: JSON.stringify(user) });
// Load
const { value } = await Preferences.get({ key: 'user' });
const user = JSON.parse(value);
```
## App Store Submission
### iOS App Store
1. **Apple Developer Account** - \$99/year
2. **Build Archive** - Product → Archive in Xcode
3. **App Store Connect** - Create app listing
4. **Upload** - Via Xcode or Transporter
5. **Submit for Review** - Usually 24-48 hours
### Google Play Store
1. **Google Play Developer Account** - \$25 one-time
2. **Build APK/Bundle** - Build → Generate Signed Bundle
3. **Play Console** - Create app listing
4. **Upload** - Upload AAB file
5. **Submit for Review** - Usually few hours
## Configuration Tips
### Splash Screen
```bash theme={null}
npm install @capacitor/splash-screen
```
```typescript theme={null}
// capacitor.config.ts
const config: CapacitorConfig = {
plugins: {
SplashScreen: {
launchShowDuration: 2000,
backgroundColor: '#ffffff',
},
},
};
```
### Status Bar
```bash theme={null}
npm install @capacitor/status-bar
```
```typescript theme={null}
import { StatusBar, Style } from '@capacitor/status-bar';
// Dark content for light backgrounds
StatusBar.setStyle({ style: Style.Dark });
```
### Safe Areas
Handle notches and home indicators:
```css theme={null}
.app-container {
padding-top: env(safe-area-inset-top);
padding-bottom: env(safe-area-inset-bottom);
}
```
## Common Issues
* Check console for errors
* Verify build completed successfully
* Check `capacitor.config.ts` webDir matches output
* Run `npx cap sync` after changes
* Check permissions in platform config
* Verify plugin is installed
* Read rejection reason carefully
* Common: missing privacy policy, incomplete metadata
* iOS: ensure proper permissions explanations
## PWA Alternative
If native apps are too complex, consider a PWA:
```
"Make this app installable as a PWA with offline support"
```
PWAs can be installed on phones without app stores, though with some limitations.
## Resources
* [Capacitor Documentation](https://capacitorjs.com/docs)
* [Apple Developer](https://developer.apple.com)
* [Google Play Console](https://play.google.com/console)
Deploy your web app to custom infrastructure
# NPM Packages
Source: https://docs.kleap.co/tips/npm-packages
Install and use third-party packages
Extend your app's functionality with NPM packages.
## Installing Packages
### Via AI
Simply ask:
```
"Install react-hook-form for better form handling"
```
```
"Add date-fns for date formatting"
```
The AI will:
1. Add the package to package.json
2. Import it where needed
3. Use it in your code
### Automatic Installation
When AI writes code using a package, it's automatically installed on next preview refresh.
## Popular Packages
### Forms
| Package | Use Case |
| ----------------------- | --------------------- |
| **react-hook-form** | Form state management |
| **zod** | Schema validation |
| **@hookform/resolvers** | Zod + react-hook-form |
```
"Add a contact form using react-hook-form with Zod validation"
```
### Dates
| Package | Use Case |
| ------------ | ---------------------------- |
| **date-fns** | Date formatting/manipulation |
| **dayjs** | Lightweight date library |
```
"Format the created_at date using date-fns"
```
### UI Enhancements
| Package | Use Case |
| ------------------- | -------------------- |
| **framer-motion** | Animations |
| **react-hot-toast** | Toast notifications |
| **sonner** | Modern toast library |
```
"Add entrance animations using framer-motion"
```
### Data Fetching
| Package | Use Case |
| ------------------------- | ----------------------- |
| **@tanstack/react-query** | Data fetching & caching |
| **swr** | Data fetching hooks |
```
"Use React Query to fetch and cache the user data"
```
### Charts
| Package | Use Case |
| ------------------- | ------------------ |
| **recharts** | React charts |
| **chart.js** | Canvas charts |
| **react-chartjs-2** | Chart.js for React |
```
"Add a line chart showing monthly revenue using recharts"
```
### Utilities
| Package | Use Case |
| ---------- | ------------------- |
| **lodash** | Utility functions |
| **clsx** | Conditional classes |
| **uuid** | Generate unique IDs |
## Using Installed Packages
Once installed, use in your code:
```typescript theme={null}
// Importing
import { format } from 'date-fns';
import { motion } from 'framer-motion';
import { useForm } from 'react-hook-form';
// Using
const formattedDate = format(new Date(), 'MMM d, yyyy');
```
## Pre-Installed Packages
These are already available:
### Core
* `astro` - Framework (static site generator)
* `react` - UI library (React 19, for interactive islands)
* `typescript` - Type safety
* `tailwindcss` - Styling (Tailwind v4)
### UI & Icons
Your interactive React islands can pull from the React 19 ecosystem:
* `lucide-react` - Icons
* `motion` - Animations
* `radix-ui` - Headless, accessible component primitives
* `clsx` - Class utilities
* `tailwind-merge` - Tailwind class merging
### Database
* `@/lib/kleap-db` - **Kleap Database** client. Use this for reading and writing data — you don't need to install a separate database client.
## Package Versions
### Checking Versions
Ask AI to check or update:
```
"What version of react-hook-form is installed?"
```
```
"Update framer-motion to the latest version"
```
### Version Compatibility
The AI typically installs compatible versions. If you need a specific version:
```
"Install react-hook-form version 7.48.0"
```
## TypeScript Types
Many packages include types. For those that don't:
```
"Install the TypeScript types for lodash"
```
This adds `@types/lodash`.
## Common Package Tasks
### Add Authentication
Kleap Database includes built-in email/password accounts, so ask for that
directly instead of installing a separate auth library:
```
"Add email and password login using Kleap Database accounts"
```
### Add Email Notifications
For an email whenever someone submits a form, use built-in **Forms** — no package needed. Sending custom transactional email from a static site requires an external provider called from your own backend (advanced):
```
"Add a contact form that emails me on each submission"
```
### Add Markdown
```
"Add support for rendering markdown content using react-markdown"
```
### Add PDF Generation
```
"Install @react-pdf/renderer for generating PDF invoices"
```
## Package Size Considerations
Be mindful of bundle size:
### Check Size
Use [bundlephobia.com](https://bundlephobia.com) to check package sizes.
### Lightweight Alternatives
| Heavy | Lighter Alternative |
| --------- | ----------------------------- |
| moment.js | date-fns, dayjs |
| lodash | lodash-es, individual imports |
| axios | native fetch |
### Tree Shaking
Import only what you need:
```typescript theme={null}
// ❌ Imports entire library
import _ from 'lodash';
// ✅ Imports only needed function
import debounce from 'lodash/debounce';
```
## Build-Time vs Browser Packages
### Build-Time Only
Some packages should only run at build time, in Astro frontmatter (the code
between the `---` fences in a `.astro` file). This code never ships to the browser:
```astro theme={null}
---
// Runs at build time only
import { someBuildThing } from 'build-package';
const data = await someBuildThing();
---
```
### Browser (Interactive Islands)
Packages that need browser APIs run inside a React island, hydrated with a
`client:*` directive:
```astro theme={null}
---
import Widget from '../components/Widget.jsx';
---
```
## Troubleshooting
* Check package name spelling
* Package might not exist on npm
* Try searching npmjs.com for correct name
* Refresh the preview
* Package might need time to install
* Check import path is correct
* Install @types/package-name
* Some packages include types already
* Check package documentation
* Ask AI to resolve version conflict
* Check peer dependencies
* May need to update other packages
## Best Practices
Choose well-maintained packages with good documentation
Consider impact on app performance
Import only functions you need
Update packages for security fixes
Add typography packages
# Preview & Build Behavior
Source: https://docs.kleap.co/tips/sandbox-behavior
Understanding how the preview environment works
Kleap builds a **static Astro site**. There's no long-running dev server or
sandbox to manage — here's how preview, builds, and publishing actually work.
## Where Your Files Live
Your site's files are stored and managed by Kleap. That managed copy is the
source of truth — the AI edits it, and every preview and publish builds from it.
You don't run or maintain a separate environment.
## Preview
When you make a change, Kleap runs a **real, ephemeral build** of your Astro
site and shows the result in the editor's preview pane.
* The preview reflects your latest changes after each build
* It's for you, inside the editor — not a public URL
* Nothing to "wake up" or restart; there's no idle timeout to hit
For a permanent, public URL, [publish the reviewed draft](/features/publishing)
to `https://your-app.kleap.io`.
## Publishing
Publishing is **deliberate**. When the preview is ready, open **Publish**, check
the address, and click **Publish** in the panel. Kleap builds your site and deploys
it to a global edge network at `https://your-app.kleap.io` with free SSL.
## What's Preserved
| Always saved | Notes |
| ------------------- | ------------------------------------ |
| All your code files | Managed by Kleap, saved continuously |
| Version history | Roll back to any previous version |
| Stored data | If you use Kleap Database |
| Form submissions | Land in your dashboard's Data panel |
Because there's no persistent dev server, there's no in-memory app state to
lose between sessions — the site is rebuilt fresh each time.
## Preview vs Production
| Aspect | Preview (in editor) | Production (kleap.io) |
| ----------- | ------------------- | ----------------------------- |
| **URL** | In-editor only | Permanent, public |
| **Uptime** | Built on demand | 24/7 on a global edge network |
| **Access** | You only | Public |
| **Purpose** | Development | Live users |
| **Build** | Ephemeral build | Deployed static build |
## Common Questions
No. Astro sites don't use a long-running sandbox. Kleap builds your site on
demand for preview and again when you choose Publish or Update.
No. Your files are managed by Kleap and saved continuously, with full version
history.
The preview shows your latest local changes. The live site updates when the
next Publish or Update build finishes.
If you added Kleap Database, your data lives there independently of any build.
Form submissions land in your dashboard's Data panel.
How your site goes live at your-app.kleap.io
# Security Tips
Source: https://docs.kleap.co/tips/security-tips
Keep your app and user data safe
Best practices for building secure applications with Kleap. Because Kleap publishes **static Astro sites**, much of the hard part is handled for you — but a few habits keep your app and users safe.
## The Golden Rules
Only publishable keys belong in a static site — never secret keys.
Only show and store the data you actually need.
Put account and dashboard pages behind a login.
Forms and saved data are validated server-side for you.
## Keeping secrets safe
Your published site is static, so **anything inside it is public**. That changes the rules for secrets compared to a traditional server app.
```txt theme={null}
// ✅ Safe in a site — publishable keys are meant to be public
Stripe publishable key pk_live_...
// ❌ Never in a site — anyone can read it
Stripe secret key sk_live_...
password / private token / database credential
```
### What must stay out of your site
* Secret API keys (`sk_...`)
* Passwords and private tokens
* Database credentials
* Any other value you wouldn't post publicly
Don't paste secret keys, passwords, or private tokens into your prompts either. If a feature needs a secret to work, it belongs on a server — use Kleap's built-in Database and Forms, which handle that for you.
## Protecting user data
If your app has logins or saves data, turn on the **Kleap Database** — a managed database with built-in user accounts. You don't connect or manage an outside database.
### Each user only sees their own data
**Per-user data isolation** is your primary defense: each signed-in user can only see and change **their own data**, even though everyone shares one database. When you add data features, ask the AI to confirm the data is scoped to the current user.
```
Can you check that my tables are protected so users can only
access their own data?
```
### Built-in accounts
Kleap Database ships with **email + password accounts** and the sign-up / log-in UI. Passwords are hashed and sessions are handled securely — you don't build any of it. To restrict who can see a page, put it behind a login:
```
Add a login and only let signed-in users see the account page.
```
## Input validation
You don't write server code on Kleap, so validation of saved data and form submissions is handled by Kleap on the server. On the page itself, still keep inputs sensible for a good experience:
* Mark required fields as required
* Keep messages and text fields to reasonable lengths
* Give clear error messages that **don't leak sensitive details**
## Forms
Any contact or lead form you add is processed server-side by Kleap. Every submission is **validated, sanitized, and rate-limited** automatically, then delivered to your dashboard. There are no keys to manage and spam protection is built in — nothing to set up.
## Preventing common attacks
### XSS (Cross-Site Scripting)
Content you display is escaped automatically, so ordinary text is safe. The risk comes from injecting **raw, unescaped HTML** from an untrusted source — avoid that pattern, and Kleap's pre-build checks will flag it if it slips in.
```txt theme={null}
✅ Safe — display text normally; it's auto-escaped
❌ Risky — injecting raw HTML from user input onto the page
```
### Data leaks between users
The way one user ends up seeing another user's data is missing per-user scoping. **Per-user data isolation** prevents this — confirm each data feature limits users to their own data.
### Transport security
All Kleap sites are served over **HTTPS/TLS automatically**, including custom domains, so traffic between your visitors and your site is encrypted with no setup.
## File uploads
If your app accepts uploads through a Kleap form, submissions are handled server-side with validation and rate limiting built in. Keep the on-page experience tidy by asking for only the file types and sizes you actually need.
## Security Checklist
Before launching:
* [ ] No secret keys, passwords, or private tokens anywhere in the site (only publishable keys)
* [ ] No secrets pasted into prompts
* [ ] If you store data, each signed-in user can only access their own data
* [ ] Private pages (dashboards, account areas) are behind a login
* [ ] Error messages don't leak sensitive info
* [ ] HTTPS enabled (automatic with Kleap)
## Security Review
Ask AI to review your app:
```
Can you do a security review of my app?
Check for:
- Any secrets accidentally left in the site
- Data that isn't scoped to the signed-in user
- Pages that should be behind a login
- Inputs that need clearer validation
```
Security is ongoing. Regularly review your app as you add features.
Built-in security features in Kleap
# Self Hosting
Source: https://docs.kleap.co/tips/self-hosting
Deploy your app to your own infrastructure
Kleap provides built-in hosting when you deliberately publish to
`https://your-app.kleap.io`. But you own your code — it's a standard **Astro**
project, so you can build it and host it anywhere that serves static or edge sites.
Self-hosting means hosting the static Astro build. Features backed by Kleap
services — **Kleap Database**, **KleapForm** submissions, and built-in user
accounts — are provided by Kleap. If your site uses them, keeping the site on
Kleap Hosting is simplest; self-hosted copies would need those services to stay
reachable.
## Getting Your Code
### Export to GitHub
1. Open **Settings > Project settings > Integrations**
2. Choose **GitHub** and click **Connect**
3. Push your code to a repository
4. Clone the repository locally
```bash theme={null}
git clone https://github.com/you/your-app.git
cd your-app
```
### Inspect Before Exporting
Open **Settings** and choose **View code** to inspect the project before pushing it to GitHub.
## Running Locally
### Prerequisites
* Node.js 18.20.8+ (or 20+/22+)
* npm or pnpm
### Setup
```bash theme={null}
npm install
npm run dev
```
Visit `http://localhost:4321` (Astro's default dev port).
### Build for Production
Astro outputs a static site to the `dist/` folder:
```bash theme={null}
npm run build # builds to ./dist
npm run preview # preview the production build locally
```
## Hosting Options
Any static or edge host works. Point it at the `dist/` output.
### Cloudflare Pages
1. Connect your GitHub repo
2. Build command: `npm run build`
3. Output directory: `dist`
### Netlify
```toml theme={null}
[build]
command = "npm run build"
publish = "dist"
```
### Vercel
1. Import the GitHub repo
2. Vercel auto-detects Astro
3. Output directory: `dist`
### Static Host / VPS
`dist/` is plain static files — serve it with Nginx, Caddy, an S3 bucket +
CDN, GitHub Pages, or any static host.
```dockerfile theme={null}
# Simple static container
FROM nginx:alpine
COPY dist/ /usr/share/nginx/html
EXPOSE 80
```
## Environment Variables
Astro exposes variables prefixed with `PUBLIC_` to the browser via
`import.meta.env`. If your site calls any external service, set its variables in
your hosting platform:
```bash theme={null}
PUBLIC_SOME_SERVICE_URL=https://...
```
Never commit `.env` files. Add them to `.gitignore` and configure secrets in
your hosting platform.
## Custom Domains
### On Kleap Hosting
If you stay on Kleap, point your domain with an **A record** to Kleap's proxy:
```
A record @ 178.104.71.55
```
Use an **A record on the root/apex domain** (root domains can't use CNAME), keep
Cloudflare DNS in **DNS-only** mode if you use Cloudflare, and Kleap issues SSL
automatically. You can also buy a domain directly in-app.
### On Your Own Host
Most platforms support custom domains from their dashboard:
1. Add the domain in your host's dashboard
2. Configure DNS per that host's instructions (A record for root, CNAME for subdomains)
3. SSL is usually automatic
## CI/CD Setup
### GitHub Actions
```yaml theme={null}
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm run build
# Add a step to publish ./dist to your platform
```
## Monitoring
### Analytics
Add analytics by including their script in your base layout:
* **Plausible** - Privacy-focused
* **Google Analytics** - Comprehensive
* **PostHog** - Product analytics
### Uptime Monitoring
* **UptimeRobot** - Free monitoring
* **Pingdom** - Professional monitoring
* **Better Uptime** - Status pages
## Performance
A static Astro build is already fast — it ships HTML with minimal JavaScript
(React only hydrates the interactive islands). To go further:
* Put a **CDN** in front of your static host (Cloudflare, CloudFront, Fastly)
* Keep images optimized and lazy-loaded
* Limit interactive islands to what actually needs them
## Comparison
| Platform | Ease | Cost | Control |
| --------------------- | ---- | --------- | ------- |
| **Kleap Hosting** | ⭐⭐⭐ | Included | Low |
| **Cloudflare Pages** | ⭐⭐⭐ | Free tier | Medium |
| **Netlify** | ⭐⭐⭐ | Free tier | Medium |
| **Static host / VPS** | ⭐ | \$ | Full |
## Troubleshooting
* Check the Node.js version (18.20.8+, or 20+/22+)
* Verify all dependencies install (`npm ci`)
* Check any required environment variables are set
* Review build logs for the specific error
* Make sure the publish/output directory is set to `dist`
* Serve `dist/` at the site root, not a subfolder
* Check your host supports clean URLs for static files
* Forms, Kleap Database, and accounts are Kleap-backed services
* Self-hosted copies need those services to remain reachable, or you'll need
to replace them
* Keeping the site on Kleap Hosting avoids this entirely
The easiest deployment option
# SEO
Source: https://docs.kleap.co/tips/seo
Optimize your app for search engines
Make your Kleap app discoverable in search engines.
Kleap builds **Astro** static sites, which are SEO- and GEO-friendly out of the box: pages are pre-rendered to fast, crawlable HTML, so search engines and AI crawlers see your content immediately. Your job is mostly to give the AI the right titles, meta tags, structured data, and image guidance.
## Basic SEO Setup
### Page Metadata
Every page should have metadata. Ask AI:
```
Add SEO metadata to the homepage with:
- Title: "MyApp - Build Apps Faster"
- Description: "Create beautiful web apps in minutes with AI"
- Open Graph tags for social sharing
```
### Implementation
In Astro, metadata lives in the page's `` as standard tags:
```astro theme={null}
---
const title = 'MyApp - Build Apps Faster';
const description = 'Create beautiful web apps in minutes with AI';
---
{title}
```
## Essential SEO Elements
### Title Tags
* **Unique per page** - Each page needs its own title
* **Under 60 characters** - Longer gets truncated
* **Include keywords** - What users search for
* **Brand at end** - "Page Name | MyApp"
```
"Update page titles to be SEO-friendly:
- Home: 'AI App Builder | MyApp'
- Pricing: 'Simple Pricing Plans | MyApp'
- About: 'About Us | MyApp'"
```
### Meta Descriptions
* **Under 160 characters** - Keep it concise
* **Include call-to-action** - Why click?
* **Unique per page** - No duplicates
### Headings
Proper heading structure matters:
```
H1 - Main page title (one per page)
H2 - Major sections
H3 - Subsections
```
```
"Fix the heading structure on the homepage.
There should be only one H1, and sections should use H2."
```
## Technical SEO
### Sitemap
Generate a sitemap for search engines:
```
"Add a sitemap.xml that includes all public pages"
```
Astro generates the sitemap for you via its official sitemap integration — you just set your site URL. The AI wires this up so a `sitemap-index.xml` is produced at build time covering every page:
```js theme={null}
// astro.config.mjs
import sitemap from '@astrojs/sitemap';
export default {
site: 'https://myapp.com',
integrations: [sitemap()],
};
```
### Robots.txt
Control what search engines can crawl:
```
"Add a robots.txt that allows all crawlers but blocks /admin"
```
Astro serves static files from `public/`, so a `robots.txt` there is picked up automatically:
```
# public/robots.txt
User-agent: *
Allow: /
Disallow: /admin/
Sitemap: https://myapp.com/sitemap-index.xml
```
### Canonical URLs
Prevent duplicate content issues with a canonical `` in the page ``:
```html theme={null}
```
## Performance for SEO
Google considers page speed. Optimize:
### Image Optimization
```
"Optimize all images: correct sizes, lazy loading, and
descriptive alt text — use Astro's where possible"
```
### Core Web Vitals
Target these metrics:
| Metric | Target | What It Measures |
| ------- | -------- | ------------------------------ |
| **LCP** | \< 2.5s | Loading speed |
| **INP** | \< 200ms | Interactivity (responsiveness) |
| **CLS** | \< 0.1 | Visual stability |
```
"Optimize the page for Core Web Vitals.
Add loading skeletons and optimize images."
```
## Content SEO
### Semantic HTML
```
"Use semantic HTML elements:
- nav for navigation
- main for main content
- article for blog posts
- section for content sections
- footer for footer"
```
### Alt Text for Images
```
"Add descriptive alt text to all images for accessibility and SEO"
```
Good alt text:
```html theme={null}
```
### Internal Linking
Link between your pages:
```
"Add internal links from the homepage to feature pages
and from blog posts to related content"
```
## Social Sharing
### Open Graph
For Facebook, LinkedIn — add Open Graph meta tags to the page ``:
```html theme={null}
```
### Twitter Cards
For Twitter/X — add Twitter Card meta tags to the page ``:
```html theme={null}
```
### Creating OG Images
```
"Create an Open Graph image template for the homepage
that shows the app name and tagline"
```
## Structured Data
Help search engines understand your content:
### Organization
```
"Add Organization structured data with our company name,
logo, and social profiles"
```
### FAQ
```
"Add FAQ structured data to the FAQ page so it can
appear in Google's rich results"
```
### Product
```
"Add Product structured data to product pages with
name, price, and availability"
```
## SEO Checklist
Before launching:
* [ ] Unique title tags per page
* [ ] Meta descriptions on all pages
* [ ] Proper heading hierarchy (one H1)
* [ ] Alt text on all images
* [ ] Sitemap.xml generated
* [ ] Robots.txt configured
* [ ] Canonical URLs set
* [ ] Open Graph tags added
* [ ] Mobile-friendly design
* [ ] Fast page load speed
* [ ] HTTPS enabled (automatic with Kleap)
* [ ] Internal linking in place
## Monitoring SEO
After launching:
1. **Google Search Console** - Monitor indexing and performance
2. **Kleap Analytics** - Track Core Web Vitals
3. **Google PageSpeed Insights** - Check performance
```
"Add Google Search Console verification meta tag"
```
Track your app's performance
# Support Policy
Source: https://docs.kleap.co/tips/support-policy
How to get help and what to expect
Our commitment to helping you succeed with Kleap.
## Getting Help
### Documentation
Always check the docs first:
* Search for your topic
* Browse related pages
* Check troubleshooting guides
### Discord Community
Join our Discord for:
* Community support
* Tips and tricks
* Feature discussions
* Sharing your projects
[Join Discord](https://discord.gg/WhQrT8RneY)
### Email Support
For account or billing issues:
* **Email**: [hello@kleap.co](mailto:hello@kleap.co)
* **Human replies**: included from Pro — billing and account problems on any plan
## Support Access
| Channel | Open to | Best for |
| -------------------- | -------- | ---------------------------------------------------------- |
| **Documentation** | Everyone | Self-service guides and troubleshooting |
| **Chat on kleap.co** | Everyone | Your own account, apps, credits and billing |
| **Discord** | Everyone | Community help, product questions, and ideas |
| **Email** | Everyone | Accounts, billing, security, and detailed technical issues |
Every channel is open on every plan. **A human answering is included from Pro**, and triaged first on Business. On Free and Launch the assistant helps as far as it can — we will not promise you a human who is not coming.
**Except for money, data and our own mistakes**, which are never gated by a plan: billing, a refund, a double charge, a failed payment, lost data, a bug on our side, or an account change only we can make reaches a human **on any plan, including Free**.
## What We Help With
### We Support
* Questions about Kleap features
* Billing and account issues
* Bug reports
* Integration questions
* General guidance
### Community Helps With
* Code debugging
* Best practices
* Project advice
* Feature implementation tips
### Outside Our Scope
* Writing your entire app for you
* Third-party service support
* Custom development work
* Legal or business advice
## Reporting Bugs
### What to Include
1. **Description** - What happened vs what you expected
2. **Steps to reproduce** - How to trigger the bug
3. **Screenshots/recordings** - Visual evidence
4. **Error messages** - Copy exact text
5. **Browser/device** - Where you saw the issue
### Where to Report
* **Chat on kleap.co** - Fastest, and it already knows your account and apps
* **Discord** - For quick community feedback
* **Email** - For confirmed bugs
* **GitHub Issues** - For our open source repositories ([kleaphq](https://github.com/kleaphq))
## Feature Requests
We love hearing ideas! Share them:
1. **Discord** - Discuss with other builders
2. **Email** - Straight to the founder
Include:
* What you want to build
* Why existing features don't work
* How it would help your workflow
## Availability and Response
Kleap is founder-run. The support assistant in the chat on kleap.co answers at any hour, but **human support is one person** — the founder — so there are no staffed support hours and no guaranteed response time. "Priority" on Business means your message is triaged first, never that it is answered within a set time.
Leave your message on any channel and it will be read. A site that is down or a failed payment is looked at first; everything else is answered in turn, and a weekend or a busy week can stretch that out. Contractual support terms, if any, are stated in the relevant agreement.
## Self-Service Resources
### Before Contacting Support
Use the search bar to find related articles
Common questions are answered in FAQ
Many issues have documented solutions
Community often responds quickly
## Incident Updates
When an active incident affects users, Kleap communicates the relevant update in the product or by email. Contact us on Discord or at [hello@kleap.co](mailto:hello@kleap.co) if you need help with a specific app.
## Security Issues
For security vulnerabilities:
* **Email**: [security@kleap.co](mailto:security@kleap.co)
* **Disclosure**: Responsible disclosure appreciated
Do not report security issues in public forums. Email us directly.
## Feedback
We actively read:
* Discord discussions
* Email feedback
* Social media mentions
* App store reviews
Your feedback shapes our roadmap.
## Support Tips
"The button doesn't work" → "The Submit button on /contact returns a 500 error after clicking"
Share what you were trying to achieve, not just what went wrong.
Refresh, clear cache, try a different browser before reporting.
Copy exact error text rather than paraphrasing.
## Account Issues
### Can't Log In
1. Check email/password are correct
2. Try password reset
3. Clear browser cookies
4. Contact support if still stuck
### Billing Questions
* **Email**: [hello@kleap.co](mailto:hello@kleap.co)
* Include your account email
* Describe the issue clearly
### Account Deletion
To delete your account:
1. Export your data if needed
2. Email [hello@kleap.co](mailto:hello@kleap.co)
3. We'll confirm the request and explain the applicable deletion timeline
All ways to reach us
# Troubleshooting
Source: https://docs.kleap.co/tips/troubleshooting
Solutions to common problems
Quick solutions to common issues you might encounter.
## Preview Issues
### Preview Not Loading
**Symptoms**: White screen, infinite loading, or error message
**Solutions**:
1. **Wait a moment** - The preview rebuilds after each change
2. **Send a message** - Any message triggers a fresh rebuild
3. **Check for errors** - Look at the error message in chat
4. **Refresh** - Click the refresh button in preview panel
5. **Check internet** - Ensure stable connection
### Preview Stopped
**Symptom**: Preview shows an error or won't refresh
**Cause**: A build may still be running or may have hit an error
**Solution**: Send any message or click refresh to rebuild the preview
### Changes Not Showing
**Symptoms**: Made changes but preview looks the same
**Solutions**:
1. Wait for the rebuild to finish (a few seconds)
2. Click refresh in preview
3. Hard refresh browser (Cmd/Ctrl + Shift + R)
4. Check for errors that might prevent rendering
## Build Errors
### Syntax Errors
**Symptom**: Error mentioning unexpected token, syntax, or parsing
**Solution**:
```
I'm getting a syntax error. Can you check and fix the code?
[paste error message]
```
### Missing Dependencies
**Symptom**: "Cannot find module" or "Module not found"
**Solution**:
```
Getting "Cannot find module 'xyz'" error.
Can you add this dependency and fix the import?
```
### Type Errors
**Symptom**: TypeScript errors about types
**Solution**:
```
Getting this type error: [error message]
Can you fix the typing?
```
## Database Issues
### Connection Failed
**Symptoms**: "Failed to connect to database"
**Solutions**:
Kleap Database is fully managed by Kleap — there's nothing to provision or
pause. If data calls fail:
1. Confirm Kleap Database is enabled for this app (it's opt-in)
2. Re-publish so the latest code is live
3. Check the error message in chat for the failing query
```
The database connection is failing. Can you check the
Kleap Database queries?
```
### Queries Return Empty
**Symptom**: Data exists but queries return empty array
**Causes**:
* Per-user data rules blocking access (the row belongs to another user)
* Wrong table name
* Query filters too restrictive
**Solution**:
```
This query returns empty but there's data in the table.
Can you check the data access rules and the query?
```
### Auth Not Working
**Symptoms**: Can't sign up, login fails, session lost
**Solutions**:
Kleap Database provides built-in email/password accounts — there are no
external auth dashboards or redirect URLs to configure.
1. Confirm Kleap Database (with accounts) is enabled for the app
2. Check for errors in the browser console
3. Describe the exact failure to the AI so it can fix the flow
```
User authentication isn't working - [describe specific issue].
Can you debug the auth flow?
```
## Deployment Issues
### Build Failed
**Symptom**: Publish fails with build error
**Solutions**:
1. Check the build log for specific error
2. Share error message with AI
3. Common fixes: missing dependencies, type errors
```
Build is failing with this error: [error message]
Can you fix it?
```
### Environment Variables Missing
**Symptom**: Works in preview but fails in production
**Cause**: Environment variables not set for production
**Solution**:
1. Go to Settings > Environment
2. Add all required variables
3. Set them for Production scope
4. Redeploy
### Domain Not Working
**Symptom**: Custom domain shows error or old site
**Solutions**:
1. Verify DNS records are correct
2. Wait for propagation (up to 48 hours)
3. Check SSL certificate status
4. Ensure domain is verified in settings
## Visual Issues
### Layout Broken
**Symptom**: Elements overlapping, wrong positioning
**Solution**:
```
The layout is broken - [describe what's wrong].
Can you fix the CSS/positioning?
```
### Not Responsive
**Symptom**: Looks bad on mobile
**Solution**:
```
This page doesn't work well on mobile. The [specific issue].
Can you make it responsive?
```
### Styling Not Applied
**Symptom**: CSS changes not appearing
**Solutions**:
1. Check for CSS conflicts
2. Verify class names are correct
3. Check Tailwind config if using custom values
## Performance Issues
### Page Loading Slowly
**Solutions**:
1. Optimize images
2. Add loading states
3. Keep components static and only hydrate interactive islands
4. Lazy load non-critical content
```
This page is loading slowly. Can you optimize it?
Consider image optimization, code splitting, and reducing client-side JavaScript.
```
### Too Many Re-renders
**Symptom**: Page feels sluggish, constant updates
**Solution**:
```
The page seems to be re-rendering too often and feels slow.
Can you optimize the component to prevent unnecessary renders?
```
## Quick Fixes
| Problem | Quick Fix |
| ---------------- | ------------------------------- |
| Preview stuck | Send any message to rebuild |
| Build error | Share error message with AI |
| Styling broken | Clear browser cache, refresh |
| Auth not working | Check Kleap Database is enabled |
| Deploy failed | Check build logs |
| Data not loading | Check per-user data rules |
| Changes lost | Use version history to restore |
## When Nothing Works
### Roll Back
1. Go to version history
2. Find a working version
3. Restore it
4. Try a different approach
### Start Fresh
For severe issues:
1. Create a new app
2. Use a template as base
3. Re-implement features carefully
4. Test after each change
### Get Help
* **Discord** - Community support
* **Email** - [hello@kleap.co](mailto:hello@kleap.co)
* **Docs** - Search for specific error
Detailed guide to specific error messages
# Using Images
Source: https://docs.kleap.co/tips/using-images
Best practices for images in your app
Learn how to effectively use images in your Kleap app.
Kleap builds **Astro** static sites, so images use standard web patterns — files in your `public/` folder, Astro's optimized `` component, or plain `` tags. There's no image build configuration to set up.
## Adding Images
### From URL
Use any public image URL:
```
"Add a hero image using this URL: https://example.com/hero.jpg"
```
External images work with a normal `` tag — no allowlist or domain configuration required.
### Uploading Images
Upload images directly in Kleap and the AI will place them for you:
```
"Add an image to the about page." (then attach or upload your image)
```
Uploaded images are hosted by Kleap and stored in your app's `public/` folder, accessible at `/image-name.jpg`.
### Generate Images with AI
Kleap can generate images for you with AI — free, no credits used:
```
"Generate a hero image of a modern office workspace for the homepage."
```
Great for hero backgrounds, illustrations, and placeholders when you don't have your own photos yet.
## Astro Image Component
For images you ship with your site, use Astro's built-in `` component from `astro:assets`. Put the source in `src/assets/` and import it:
```astro theme={null}
---
import { Image } from 'astro:assets';
import hero from '../assets/hero.jpg';
---
```
### Benefits
* **Automatic optimization** - Converts to WebP/AVIF
* **Lazy loading** - `loading="lazy"` by default
* **Correct sizing** - Serves an appropriately sized image
* **No layout shift** - Requires width/height, which prevents CLS
### Plain img tags
For images in `public/` (including uploaded and AI-generated ones), a normal `` works too — just add `width`, `height`, and `loading="lazy"`:
```html theme={null}
```
For a hero image (usually your largest, above-the-fold visual), load it eagerly so it appears fast:
```html theme={null}
```
### Ask AI to Optimize
```
"Optimize all images: use Astro's where possible, add
correct width and height, lazy loading, and descriptive alt text."
```
## Image Best Practices
### File Formats
| Format | Best For |
| -------- | -------------------------- |
| **WebP** | Photos, general use |
| **PNG** | Logos, icons, transparency |
| **SVG** | Icons, illustrations |
| **AVIF** | Best compression (newer) |
### File Sizes
Keep images optimized:
* **Hero images**: \< 200KB
* **Content images**: \< 100KB
* **Thumbnails**: \< 30KB
### Dimensions
Provide images at appropriate sizes. For responsive images, tell the browser which size to load with the `widths` and `sizes` props:
```astro theme={null}
```
## Responsive Images
### Cover a Container
To fill a container while keeping aspect ratio, size the wrapper and use `object-cover`:
```html theme={null}
```
### Responsive Sizes
Tell the browser what size to load:
```astro theme={null}
```
## External Images
For images hosted elsewhere (Unsplash, a CDN, your own server), just reference the URL with a plain ``:
```html theme={null}
```
No domain allowlist or config is needed — Astro sites serve external image URLs directly. Popular sources include:
* `images.unsplash.com`
* `cdn.pixabay.com`
* `res.cloudinary.com`
## Uploaded & Generated Images
Most images on a Kleap site are static assets — files you upload in Kleap or generate with AI. These are hosted by Kleap in your `public/` folder, so you reference them like any local image:
```html theme={null}
```
If you need to accept image uploads from your own visitors at runtime, store them in Kleap Database and render them from the stored URL. For most sites, static uploaded or AI-generated assets are all you need.
## Background Images
### CSS Background
For decorative backgrounds:
```html theme={null}
Content here
```
### With Overlay
```html theme={null}
Content here
```
## Icons
### Lucide Icons
Kleap uses Lucide icons via `lucide-react`, rendered inside React islands:
```tsx theme={null}
import { Home, Settings, User } from 'lucide-react';
```
### SVG Icons
For custom icons:
```html theme={null}
```
## Alt Text Guidelines
Always provide descriptive alt text:
```html theme={null}
```
### When to Use Empty Alt
Decorative images that don't convey information:
```html theme={null}
```
## Common Image Patterns
### Hero with Image
```
"Create a hero section with a large background image,
overlay, and centered text content"
```
### Image Gallery
```
"Add an image gallery with a grid layout that opens
images in a lightbox when clicked"
```
### Avatar
```
"Add user avatars to the comments section using each
person's profile image"
```
## Troubleshooting
* Check the file path is correct
* Verify the image exists in the public folder
* For external images, confirm the URL is public and reachable
* Provide a higher resolution source image
* Check width/height props match the aspect ratio
* Prefer Astro's `` so the right size is served
* Always specify width and height
* Use Astro's ``, which reserves space automatically
* Wrap in a sized container for cover/fill layouts
Learn how to embed videos in your app
# Using Videos
Source: https://docs.kleap.co/tips/using-videos
Embed and display videos in your app
Add video content to your Kleap app for tutorials, demos, and media-rich experiences.
## Embedding YouTube
The easiest way to add video:
```
"Embed this YouTube video in the hero section:
https://youtube.com/watch?v=xxxxx"
```
### Implementation
```typescript theme={null}
```
### Responsive YouTube
```typescript theme={null}
```
## Embedding Vimeo
Similar to YouTube:
```
"Embed this Vimeo video: https://vimeo.com/xxxxx"
```
```typescript theme={null}
```
## Self-Hosted Videos
### HTML5 Video
For videos in your public folder:
```typescript theme={null}
```
### With Poster
Show an image before playing:
```typescript theme={null}
```
### Autoplay (Muted)
Autoplay requires muted for most browsers:
```typescript theme={null}
```
## Video Backgrounds
### Hero with Video Background
```
"Create a hero section with a video background,
dark overlay, and centered text"
```
```typescript theme={null}
Welcome
```
## Hosting Larger Videos
Short clips can live in your `public/` folder and play with a standard `