Build your store with Lovable
You already have a Khaime store with products. Lovable can build a shop website for it: you describe the look in plain words and Lovable designs every page. Khaime keeps doing the work behind it: your products and stock, the cart, checkout and payments, orders, receipts, cart recovery and Khai. You keep managing everything in your Khaime dashboard, as you do today. You do not need to write code, copy keys or know how websites work.I want a new shop website
Tap Build my shop with Lovable in Khaime. Lovable opens with everything filled in.
I already have a website
Built with Lovable, Bolt, v0 or Replit? Tap Copy for Lovable and paste it into its chat.
Before you start
- Add your products in Khaime first, with photos and prices. Lovable builds the shop around what you sell, and anything you add later shows up on its own.
- Add your logo in Khaime (Manage store). Lovable uses it, and your brand colour, for the design.
- A Lovable account. You can sign up for free when Lovable opens. Lovable’s own plans and credits are separate from Khaime.
Build a new shop in five steps
1
Tap Build my shop with Lovable
In your Khaime dashboard, open Your website and tap Build my shop with Lovable. Lovable opens in a new tab. This also switches on selling from your website, so there is nothing else to set up.
2
Sign in to Lovable and press send
Sign in or sign up. The request is already written for you, with your store attached as a design reference. Lovable never starts until you press send, so you can add your own wishes first, for example “warm and minimal, lots of white space, a dark green accent”.
3
Watch Lovable build your shop
Lovable builds a home page with your products, a product page with photos and options, a cart, a checkout page and a thank-you page. It uses your real products, prices and photos from Khaime, in your store’s colours.
4
Test with a real order
Your shop takes real payments from the start. In Lovable’s preview, buy something cheap, check the order appears in Orders in Khaime, then refund it there.
5
Publish
Tap Publish in Lovable. Your shop works on Lovable’s address straight away. To use your own domain, see Your website address.
What Lovable gets when you tap the button
The button opens Lovable with two things, and nothing private:- A request to build your shop, with the Khaime setup in it: one script line, your store ID, your public store key, and the rules Lovable must follow (below).
- Your store page, a public page Khaime makes from your store: your name, logo, brand colour, description, what you sell and your products with photos, prices and options. Lovable uses it to match your look. It is told not to copy products into the code, so your website always shows what is in Khaime right now.
Add Khaime to a website you already built
If your website already exists, in Lovable or in Bolt, v0, Replit or another AI website builder:- In Khaime, open Your website and tap Copy for Lovable.
- Paste it into your project chat and send it.
src/lib/khaime.ts with your store ID, key and the rules, and shows your products on the home page.
Everything Khaime does keeps working
Your Lovable shop is a full Khaime store, not just a catalogue:The rules Lovable follows
Lovable writes them intosrc/lib/khaime.ts and reads that file before every later change to products, prices, the cart or checkout, so you never have to repeat them. In short:
- Design is yours. Every page and layout can look however you ask. Only the payment window belongs to Khaime.
- Products come from Khaime, through
khaime.getProducts()andkhaime.getProduct(id). Never typed into the website. - Prices are shown exactly as Khaime sends them (
formatted_price). The website never adds, converts or discounts anything. - Options (size, colour) come from
product.variants. Each option carries its own full price, and sold-out options can’t be picked. - Currency picker only when your store sells in several currencies (see below).
- Cart and checkout: physical products go in
khaime.cart(); the Checkout button goes to your own/checkoutpage, wherekhaime.mountCartCheckout('#khaime-checkout')shows the checkout as part of the page, not a popup (how). Digital products, gift cards and events get a Buy now button instead. - No database, login, payment form or price sums in the website. Khaime does all of that.
- If anything from Khaime fails, Lovable reads the
[Khaime]message in the browser console and does what it says.
Currency: shoppers pay in their own currency
Shoppers can switch currency on your website, but only if your store sells in several currencies.
- Your store sells in several currencies: each shopper first sees prices in their own currency (a shopper in Nairobi sees KES), and a currency picker in the header lets them switch. The cart and checkout follow their choice.
- Your store sells in one currency: every shopper sees that one currency and there is no currency picker. Checkout only takes that currency, so showing another would only lead to a failed payment.
khaime.getCurrencies() and shows the picker only when canSwitch is true. When a shopper picks one, it calls khaime.setCurrency(code), which waits until the cart is repriced, and loads the products again.
Options: sizes, colours and their prices
If a product has options, each one is inproduct.variants with its own full price already worked out, for example Black: KES 21,623.68 when black costs more. The website shows that price when the option is picked and never adds prices together. Options you mark sold out in Khaime can’t be picked, and stock you keep per option counts on its own: a hoodie with stock only on its colours still sells.
Your website address
Your shop works on Lovable’s preview and published addresses (*.lovable.app, *.lovableproject.com) as they are, and the same goes for Bolt (*.bolt.host and its editor preview) and v0 (*.vusercontent.net). Remixing or republishing there needs nothing from you.
When you connect your own domain, open Your website in Khaime. It shows “Your shop was opened from myshop.com. Is this your website?” Tap Yes and your shop works there. Once you have confirmed a website, any other address is refused until you say yes to it, so nobody can put your shop on their site.
Before you go live
- Your products show with the right photos and prices.
- Picking an option shows that option’s price.
- The currency picker shows only if your store sells in several currencies.
- Add to cart, the cart total and Checkout work on a phone.
- A test order appears in Orders in Khaime, and you refunded it.
- On your own domain, you tapped Yes on “Is this your website?” in Khaime.
If something does not work
The Khaime script writes a plain message starting with[Khaime] in the browser console whenever something goes wrong, saying what happened and what to do. Lovable reads it and usually fixes it by itself. If it doesn’t, paste the message into the Lovable chat. The common ones:
Questions
Do I need to update the website when I add or change products? No. Products, prices, photos and stock load from Khaime each time a page opens. Can I change the design later? Yes, as often as you like. Keep prompting Lovable. The rules insrc/lib/khaime.ts keep the shop parts working.
Who handles payments, shipping and refunds? Khaime, exactly as in your Khaime store. Orders, payouts and refunds are all in your dashboard.
Does this cost extra on Khaime? No. Lovable charges for its own plans and credits.
Can I ask Lovable about my sales too? Yes. Connect Khaime to Lovable’s chat and ask about sales, stock and Store Pulse. See Ask about your store in Lovable.
Can my website show my traffic or sales? Not on a public page. A private page can, through a server function that holds your private key. See Show your store’s data.
Why it works this way
- Your design stays yours. Khaime sends Lovable plain product data, so Lovable can lay it out any way you ask.
- Money stays safe. Prices, shipping, coupons and fees are worked out by Khaime when the shopper pays, so nothing typed into a website can change what is charged.
- Your key is safe to show. A storefront key can only show your products and start a checkout. It cannot see orders or customers or touch payouts.
- Nothing private in the link. The button only carries your public store key and your public store page. Lovable never sees your password or private keys.
