@vennio/widget is a drop-in iframe widget. Two lines of HTML embed the full booking flow on any page. When a booking completes, an onBooked callback fires with the booking details.
CDN (no build step):
<script src="https://unpkg.com/@vennio/widget"></script>
npm:
npm install @vennio/widget
Place a div with data-vennio-booking and the script tag. The widget initialises automatically:
<script src="https://unpkg.com/@vennio/widget"></script>
<div
data-vennio-booking
data-shortcode="your-shortcode"
data-height="700px"
data-width="100%"
></div>
For more control, initialise the widget from your own code:
import { init } from '@vennio/widget'
init(document.getElementById('booking-widget'), {
shortcode: 'your-shortcode',
onBooked: (data) => console.log('Booked:', data)
})
| Option | Type | Default | Description |
|---|---|---|---|
shortcode |
string |
— | Required. The Venn Link shortcode to embed |
baseUrl |
string |
https://app.vennio.app |
Origin that serves the booking page. Only messages from this exact origin reach onBooked |
height |
string |
700px |
Height of the iframe (any valid CSS dimension) |
width |
string |
100% |
Width of the iframe (any valid CSS dimension) |
onBooked |
(data: BookingData) => void |
— | Callback fired when a booking completes |
allowedOrigins |
string[] |
— | Extra exact origins allowed to send booking events, for example http://localhost:5173 in development |
interface BookingData {
startTime: string // ISO 8601
endTime: string // ISO 8601
customerEmail?: string
shortCode?: string // the Venn Link shortcode
bookingId?: string // not sent by the hosted booking page today
customerName?: string // not sent by the hosted booking page today
}
height and width accept any valid CSS dimension (e.g. 600px, 80vh, 100%). Theming inside the booking form is not supported — the UI is rendered inside a hosted iframe page.
vennio:booking_confirmed message to the parent window when a booking completes, and the widget passes it to onBooked. The older vennio:booking:complete name is still accepted.onBooked only fires for messages sent by the widget's own iframe from the exact origin of baseUrl. localhost is not allowed by default. For local development, list it in allowedOrigins.onBooked does not fire there.