agentic-booking
v0.1.2
Published
AI-powered booking SDK - Add conversational booking to any app in 10 minutes
Maintainers
Readme
Agentic Booking
Add AI-powered booking to any chatbot in 10 minutes
Stop sending users to external booking links. Let them book directly in the conversation.
User: "I want to book a haircut for Saturday"
Your Bot: "Great! Saturday works. I have 10am, 2:30pm, or 4pm available.
Which works for you?"
User: "2:30"
Your Bot: "Perfect! Booked for Saturday at 2:30pm. See you then! 💇"Why Agentic Booking?
| The Old Way | With Agentic Booking |
|-------------|---------------------|
| Send Calendly link → User leaves chat → 40% drop off | Natural conversation → Booking done → 0% drop off |
| Build custom AI integration (4 weeks) | npm install + 10 minutes |
| Handle edge cases yourself | AI handles clarification, timezones, conflicts |
| Locked to one calendar | Works with ANY calendar/database via callbacks |
Quick Start
npm install agentic-bookingconst AgenticBooking = require('agentic-booking');
const booking = new AgenticBooking({
apiKey: 'pk_live_...', // Get from dashboard
// Connect to YOUR calendar
onCheckAvailability: async ({ date, time }) => {
const slot = await myCalendar.check(date, time);
return { available: slot.free };
},
// Connect to YOUR database
onCreateBooking: async ({ date, time, customerName, customerEmail }) => {
const result = await myDB.createBooking({ date, time, customerName, customerEmail });
return { bookingId: result.id, confirmed: true };
}
});
// Handle any message from any platform
app.post('/webhook', async (req, res) => {
const reply = await booking.handleMessage(
req.body.message,
req.body.userId,
{ platform: 'TELEGRAM' }
);
res.json({ text: reply });
});That's it. The AI handles the conversation flow.
Works With Everything
| Platform | Status | |----------|--------| | Telegram Bots | ✅ Production Ready | | WhatsApp Business | ✅ Production Ready | | Web Chat | ✅ Production Ready | | Facebook Messenger | ✅ Production Ready | | Discord Bots | ✅ Production Ready | | Custom APIs | ✅ Production Ready |
Example: Telegram Bot
const TelegramBot = require('node-telegram-bot-api');
const AgenticBooking = require('agentic-booking');
const bot = new TelegramBot(process.env.TELEGRAM_TOKEN, { polling: true });
const booking = new AgenticBooking({
apiKey: process.env.AGENTIC_API_KEY,
onCheckAvailability: async ({ date, time }) => {
// Check your Google Calendar, database, or any system
return { available: true };
},
onCreateBooking: async (data) => {
// Save to your database
console.log('New booking:', data);
return { bookingId: `BK-${Date.now()}`, confirmed: true };
}
});
bot.on('message', async (msg) => {
const response = await booking.handleMessage(
msg.text,
msg.from.id.toString(),
{ platform: 'TELEGRAM' }
);
bot.sendMessage(msg.chat.id, response);
});The AI Understands
The AI handles natural language booking requests:
- ✅ "Book me for tomorrow at 3pm"
- ✅ "I need an appointment next week"
- ✅ "What times do you have on Saturday?"
- ✅ "Can I reschedule to Monday?"
- ✅ "My name is John, email [email protected]"
It will ask for clarification when needed:
- "What date works for you?"
- "What time would you prefer?"
- "What's your name and email for the booking?"
How It Works
┌─────────────────────────────────────────────────────────────────────┐
│ YOUR CHATBOT │
│ (Telegram, WhatsApp, Web, etc.) │
└──────────────────────────────┬──────────────────────────────────────┘
│
│ booking.handleMessage(message, userId)
▼
┌─────────────────────────────────────────────────────────────────────┐
│ AGENTIC BOOKING SDK │
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌─────────────────┐ │
│ │ Message In │───▶│ Claude AI │───▶│ Tool Execution │ │
│ └─────────────┘ └──────────────┘ └────────┬────────┘ │
│ │ │
│ your callbacks: │
│ onCheckAvailability() │
│ onCreateBooking() │
└──────────────────────────────────────────────────┬──────────────────┘
│
▼
┌───────────────────┐
│ YOUR CALENDAR │
│ YOUR DATABASE │
└───────────────────┘Configuration Options
new AgenticBooking({
// Required
apiKey: 'pk_live_...',
onCheckAvailability: async ({ date, time }) => { ... },
onCreateBooking: async ({ date, time, customerName, customerEmail }) => { ... },
// Optional
onCancelBooking: async ({ bookingId }) => { ... },
onGetBookings: async ({ userId }) => { ... },
baseUrl: 'https://custom-backend.com', // If self-hosting
debug: true, // Enable logging
callbackTimeout: 30000 // Callback timeout in ms
});Callback Response Format
onCheckAvailability
// Input
{ date: '2024-02-10', time: '14:30' }
// Expected output
{
available: true,
message: 'That slot is open!' // Optional
}onCreateBooking
// Input
{
date: '2024-02-10',
time: '14:30',
customerName: 'John Doe',
customerEmail: '[email protected]',
customerPhone: '+1234567890', // If provided
duration: 60 // In minutes, if specified
}
// Expected output
{
bookingId: 'BK-12345',
confirmed: true,
message: 'Booking confirmed!' // Optional
}Get Your API Key
- Sign up at agentic-booking-sdk.vercel.app
- Go to API Keys section
- Click Create API Key
- Copy the key (shown only once!)
Pricing
| Plan | Messages/Month | Price | |------|----------------|-------| | Free | 100 | $0 | | Starter | 1,000 | $29/mo | | Pro | 5,000 | $99/mo | | Business | 25,000 | $299/mo |
Use Cases
- Salons & Spas - Book appointments via Instagram DM bot
- Dental Clinics - WhatsApp booking assistant
- Tutors - Telegram bot for scheduling lessons
- Consultants - Website chat for booking calls
- Photographers - Facebook Messenger booking
- Personal Trainers - In-app booking for fitness apps
Coming Soon
- [ ] Cancel & reschedule flows
- [ ] List available providers (multi-staff)
- [ ] Recurring appointments
- [ ] Calendar sync (Google, Outlook)
- [ ] Payment integration (Stripe)
Support
License
MIT © Paaras
