Quick start
You need a devalender account with a handle and at least one event type. Sign up if you do not have one, then create an event type in your dashboard. Note the handle and the event slug. The examples use ada and intro-call; replace them.
Prefer to click? The embed builder generates these snippets for you.
1. Add the widget
Load the hosted bundle once, then use the element anywhere on the page. widget.js is cached for five minutes, so fixes reach your site without a redeploy.
<script src="https://devalender.com/widget.js"></script>
<devalender-booking handle="ada" event="intro-call"></devalender-booking>Install the package with your package manager.
npm install @devalender/widgetpnpm add @devalender/widgetyarn add @devalender/widgetThen render the component. It renders nothing on the server and defines the custom elements after mount, so it is safe in Next.js.
import { DevalenderBooking } from '@devalender/widget/react';
export function Book() {
return (
<DevalenderBooking
handle="ada"
event="intro-call"
onBooked={(e) => console.log('Booked', e.detail.booking.id)}
/>
);
}No code needed. Link to the hosted booking page from a button or an email signature:
<a href="https://devalender.com/ada/intro-call">Book a call</a>See booking links for every URL.
2. See a booking arrive
Open your page, pick a slot and book it with an address you control. The booking shows up in your dashboard and you get a confirmation email.
The example above is the real widget against our demo host. Demo bookings send no email and disappear shortly.
3. React to it
Listen for the devalender:booked event in the browser, or get a signed server-side call with webhooks:
<script>
document.addEventListener('devalender:booked', (e) => {
console.log('Booked', e.detail.booking.id);
});
</script>Next steps
- Every attribute, event and theming option: booking widget, slot picker, schedule calendar.
- Notify your own systems: webhooks.
- Automate everything else: the REST API and the CLI.