Sign in for interactive examples and your API keys.
Get free API keysGetting started
Install the SDK, get a test key, and make your first booking in minutes.
Install the SDK
The BookRails TypeScript SDK is the fastest way to integrate. Python and Go SDKs are also available.
bash
# Install the SDK
npm install @bookrails/sdk
# Set your key
export BOOKRAILS_API_KEY=br_test_your_key_hereYour first booking
Search for available slots, then create a booking. The API is idempotent — safe to retry with the same key.
javascript
import BookRails from "@bookrails/sdk";
const br = new BookRails(process.env.BOOKRAILS_API_KEY);
// 1. Search availability
const slots = await br.availability.search({
service: "haircut",
near: "Brooklyn, NY",
after: new Date().toISOString(),
});
// 2. Create booking
const booking = await br.bookings.create({
slotId: slots[0].id,
customer: { name: "Olivia Bennett", email: "olivia@example.com" },
idempotencyKey: crypto.randomUUID(),
});
console.log(booking.confirmationCode); // "LUME-7F3A"Use the sandbox
Test keys (prefixed br_test_) always hit the sandbox. The sandbox has seeded businesses, realistic availability, and simulated outcomes. Switch to br_live_ to go live.