Loading...
Loading...
Ground-truth reference for building integrations on the Opencals hosted booking API with @opencals/storefront-sdk. Use whenever you are writing, reviewing or debugging code that talks to Opencals — availability, carts, appointments, checkout/payments, customer accounts (self-service), guests and attendees, custom durations, discounts (automatic / codes / balance credit), rescheduling and cancellation, addresses and marketing consent, or when you hit 429s / rate limits. Works alongside the `opencals-build-booking-site` skill (which scaffolds a whole site) but applies to ANY stack: a template, a from-scratch app, an embed on an existing site, or a v0/Lovable/Bolt build.
npx skill4agent add letsopencals/skills opencals-storefront-api@opencals/storefront-sdknode_modules/@opencals/storefront-sdk/distsrc/client/*.gen.tsopencals-build-booking-site// lib/opencals.ts — imported once at the top of every server file that calls the API
import { setupOpencals } from '@opencals/storefront-sdk';
setupOpencals({
baseUrl: process.env.OPENCALS_API_URL ?? 'https://api.opencals.com',
apiKey: process.env.OPENCALS_API_KEY, // sfk_… storefront key, from the dashboard
logging: process.env.NODE_ENV === 'development',
});import { ProductService, CartService, AppointmentService } from '@opencals/storefront-sdk';X-Api-VersionthrowOnErrorreferences/setup.mdProductService.getCurrentAvailabilitiesgetCurrentAvailabilitiesMergedreferences/availability.mdCartService.createOrGetX-Cart-Idreferences/cart-lifecycle.mdAppointmentService.createcartIdnumberOfAttendeesreferences/guests-attendees.mdCheckoutService.start → saveCustomer → saveAnswers → submitreferences/checkout.md| File | Covers |
|---|---|
| |
| |
| |
| |
| create/get, |
| |
| password + passwordless + OAuth login, sessions, |
| |
| automatic vs code ( |
| 429 handling, |
| reading |
references/*.d.tstimezoneOpencalsApiError