Skip to main content
A Lovable custom connector registers the Opencals API once for the whole workspace. Two knowledge files teach Lovable how to use it, and the key lives in Lovable’s encrypted connector credentials, never in project code. Describe a business and Lovable builds a site that reads your real services, shows live availability, holds the slot during checkout and takes payment through your own Stripe account.
You need admin or owner rights in the Lovable workspace to create a custom connector. Anyone in the workspace can connect to it afterwards.
1

Create a storefront key without allowed origins

In the Opencals dashboard open Settings → API Keys and create a key (sfk_…). Name it “Lovable” and leave allowed origins empty: Lovable calls the API from its gateway, which sends no Origin header, so a key with an allowlist fails with 401 Origin not allowed for this API key.
2

Create the connector

In Lovable open Connectors → + → Custom connector and fill in the details:
3

Authentication: Advanced, two headers

Set API base URL to https://api.opencals.com and choose Advanced:Test request: GET /storefront/stores/public-settings. It returns 200 with the store name and currency when the key and version header are right.
Every storefront route returns 404 Cannot GET … without X-Api-Version: 1, including the test request.
4

Add the two knowledge files

Click Add knowledge file twice. Use the name and description exactly; Lovable reads the description to decide which file to open.File 1. Name: Opencals Storefront API. Description: Complete endpoint reference: catalogue, availability, cart, appointments, discounts, checkout and payment, customer accounts, reschedule/cancel, errors and rate limits.
opencals-storefront-api.md
File 2. Name: Opencals booking site playbook. Description: How to build a booking website on Opencals: choosing the booking flow for the business type, pages and components, slot picker, checkout and payment UX, design and launch checklist.
lovable-booking-site-playbook.md
Raw files: opencals-storefront-api.md · lovable-booking-site-playbook.md. Then click Create.
5

Connect and describe the business

Open the connector, Add connection, enter your sfk_… key and 1, choose who can use it, and link it to a project. Then prompt with the business, not the booking system:

How it works

Lovable generates one thin server function per operation (list services, get slots, book, start checkout) that calls Opencals through the connector; the browser only talks to those functions. Card payments render Stripe’s Payment Element with the publishableKey, stripeAccountId and clientSecret that checkout/start returns, so no Stripe connector or Stripe secret is needed in Lovable.

Limits

  • Rate limits are app-wide. The API allows 20 req/s, 60 per 10 s and 120 per minute per key and client IP. Lovable’s gateway sends all visitors from the same IP range, so one Lovable site shares ~120 requests/minute. The playbook tells Lovable to cache the catalogue and use availability ranges for calendars.
  • Development stores run Stripe in test mode. Switch the store to production to take real payments.

Troubleshooting

Last modified on September 26, 2026