Google Antigravity Directory

The #1 directory for Google Antigravity prompts, rules, workflows & MCP servers. Optimized for Gemini 3 agentic development.

Resources

PromptsMCP ServersAntigravity RulesGEMINI.md GuideBest Practices

Company

Submit PromptAntigravityAI.directory

Popular Prompts

Next.js 14 App RouterReact TypeScriptTypeScript AdvancedFastAPI GuideDocker Best Practices

Legal

Privacy PolicyTerms of ServiceContact Us
Featured on FazierFeatured on WayfindioAntigravity AI - Featured on Startup FameFeatured on Wired BusinessFeatured on Twelve ToolsListed on Turbo0Featured on findly.toolsFeatured on Aura++That App ShowAI ToolzShinyLaunchMillion Dot HomepageSolver ToolsFeatured on FazierFeatured on WayfindioAntigravity AI - Featured on Startup FameFeatured on Wired BusinessFeatured on Twelve ToolsListed on Turbo0Featured on findly.toolsFeatured on Aura++That App ShowAI ToolzShinyLaunchMillion Dot HomepageSolver Tools

© 2026 Antigravity AI Directory. All rights reserved.

The #1 directory for Google Antigravity IDE

This website is not affiliated with, endorsed by, or associated with Google LLC. "Google" and "Gemini" are trademarks of Google LLC.

Antigravity AI Directory
PromptsMCPBest PracticesUse CasesLearn
Home
Prompts
Cal.com Scheduling Integration

Cal.com Scheduling Integration

Master Cal.com scheduling integration for Google Antigravity IDE applications

Cal.comSchedulingBookingTypeScript
by Antigravity AI
⭐0Stars
.antigravity
# Cal.com Scheduling Integration for Google Antigravity IDE

Integrate Cal.com scheduling into your applications using Google Antigravity IDE. This guide covers API integration, embedded booking, webhooks, and custom availability patterns for appointment-based features.

## API Client Setup

```typescript
// src/lib/cal.ts
import { createClient, type CalClient } from "@calcom/sdk";

export const cal = createClient({
  apiKey: process.env.CAL_API_KEY!,
  baseUrl: process.env.CAL_API_URL ?? "https://api.cal.com/v1",
});

// Type definitions
export interface EventType {
  id: number;
  title: string;
  slug: string;
  length: number;
  description?: string;
  locations: Array<{
    type: string;
    link?: string;
    address?: string;
  }>;
  customInputs: Array<{
    id: number;
    label: string;
    type: "text" | "textLong" | "number" | "bool" | "phone";
    required: boolean;
  }>;
}

export interface Booking {
  id: number;
  uid: string;
  title: string;
  description?: string;
  startTime: string;
  endTime: string;
  attendees: Array<{
    email: string;
    name: string;
    timeZone: string;
  }>;
  status: "ACCEPTED" | "PENDING" | "CANCELLED" | "REJECTED";
  location?: string;
  metadata: Record<string, unknown>;
}

export interface AvailabilitySlot {
  start: string;
  end: string;
}
```

## Availability and Booking API

```typescript
// src/services/scheduling.ts
import { cal, type Booking, type AvailabilitySlot } from "@/lib/cal";

export async function getEventTypes(): Promise<EventType[]> {
  const response = await cal.get("/event-types");
  return response.event_types;
}

export async function getAvailability(
  eventTypeId: number,
  dateFrom: string,
  dateTo: string,
  timeZone: string = "UTC"
): Promise<AvailabilitySlot[]> {
  const response = await cal.get("/availability", {
    params: {
      eventTypeId,
      dateFrom,
      dateTo,
      timeZone,
    },
  });

  return response.slots.flatMap((day: { slots: AvailabilitySlot[] }) => day.slots);
}

export async function createBooking(data: {
  eventTypeId: number;
  start: string;
  end: string;
  name: string;
  email: string;
  timeZone: string;
  notes?: string;
  customInputs?: Record<string, string | number | boolean>;
  metadata?: Record<string, unknown>;
}): Promise<Booking> {
  const response = await cal.post("/bookings", {
    eventTypeId: data.eventTypeId,
    start: data.start,
    end: data.end,
    responses: {
      name: data.name,
      email: data.email,
      notes: data.notes,
      ...data.customInputs,
    },
    timeZone: data.timeZone,
    language: "en",
    metadata: data.metadata,
  });

  return response.booking;
}

export async function cancelBooking(
  bookingId: number,
  reason?: string
): Promise<void> {
  await cal.delete(`/bookings/${bookingId}`, {
    data: { reason },
  });
}

export async function rescheduleBooking(
  bookingId: number,
  newStart: string,
  reason?: string
): Promise<Booking> {
  const response = await cal.patch(`/bookings/${bookingId}`, {
    start: newStart,
    rescheduleReason: reason,
  });

  return response.booking;
}
```

## Embedded Booking Component

```typescript
// src/components/BookingEmbed.tsx
"use client";

import { useEffect, useRef, useState } from "react";
import Cal, { getCalApi } from "@calcom/embed-react";

interface BookingEmbedProps {
  calLink: string;
  eventTypeSlug?: string;
  prefillData?: {
    name?: string;
    email?: string;
    notes?: string;
    guests?: string[];
    customInputs?: Record<string, string>;
  };
  onBookingComplete?: (booking: { uid: string; title: string }) => void;
  theme?: "light" | "dark" | "auto";
  hideEventTypeDetails?: boolean;
}

export function BookingEmbed({
  calLink,
  eventTypeSlug,
  prefillData,
  onBookingComplete,
  theme = "auto",
  hideEventTypeDetails = false,
}: BookingEmbedProps) {
  const [isReady, setIsReady] = useState(false);
  const calRef = useRef<HTMLDivElement>(null);

  useEffect(() => {
    (async () => {
      const cal = await getCalApi();
      
      // Configure UI settings
      cal("ui", {
        theme,
        hideEventTypeDetails,
        layout: "month_view",
        styles: {
          branding: { brandColor: "#3b82f6" },
        },
      });

      // Listen for booking events
      cal("on", {
        action: "bookingSuccessful",
        callback: (e) => {
          onBookingComplete?.(e.detail.data);
        },
      });

      setIsReady(true);
    })();
  }, [theme, hideEventTypeDetails, onBookingComplete]);

  const calUrl = eventTypeSlug
    ? `${calLink}/${eventTypeSlug}`
    : calLink;

  return (
    <div ref={calRef} className="cal-embed-container">
      {isReady && (
        <Cal
          calLink={calUrl}
          config={{
            name: prefillData?.name,
            email: prefillData?.email,
            notes: prefillData?.notes,
            guests: prefillData?.guests,
            ...prefillData?.customInputs,
          }}
          style={{
            width: "100%",
            height: "100%",
            overflow: "scroll",
          }}
        />
      )}
    </div>
  );
}
```

## Webhook Handler

```typescript
// src/app/api/webhooks/cal/route.ts
import { NextRequest, NextResponse } from "next/server";
import crypto from "crypto";
import { db } from "@/lib/db";
import { sendEmail } from "@/lib/email";

const WEBHOOK_SECRET = process.env.CAL_WEBHOOK_SECRET!;

function verifySignature(payload: string, signature: string): boolean {
  const expectedSignature = crypto
    .createHmac("sha256", WEBHOOK_SECRET)
    .update(payload)
    .digest("hex");
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expectedSignature)
  );
}

export async function POST(request: NextRequest) {
  const payload = await request.text();
  const signature = request.headers.get("x-cal-signature-256") ?? "";

  if (!verifySignature(payload, signature)) {
    return NextResponse.json({ error: "Invalid signature" }, { status: 401 });
  }

  const event = JSON.parse(payload);

  switch (event.triggerEvent) {
    case "BOOKING_CREATED":
      await handleBookingCreated(event.payload);
      break;
    case "BOOKING_CANCELLED":
      await handleBookingCancelled(event.payload);
      break;
    case "BOOKING_RESCHEDULED":
      await handleBookingRescheduled(event.payload);
      break;
    case "MEETING_ENDED":
      await handleMeetingEnded(event.payload);
      break;
  }

  return NextResponse.json({ received: true });
}

async function handleBookingCreated(booking: Booking) {
  await db.appointment.create({
    data: {
      calBookingId: booking.id,
      calBookingUid: booking.uid,
      title: booking.title,
      startTime: new Date(booking.startTime),
      endTime: new Date(booking.endTime),
      attendeeEmail: booking.attendees[0]?.email,
      attendeeName: booking.attendees[0]?.name,
      status: "scheduled",
    },
  });

  await sendEmail({
    to: booking.attendees[0]?.email,
    template: "booking-confirmation",
    variables: {
      title: booking.title,
      startTime: booking.startTime,
      location: booking.location,
    },
  });
}
```

## Best Practices for Google Antigravity IDE

When integrating Cal.com with Google Antigravity, use the SDK for type-safe API calls. Implement webhook signature verification. Use embedded booking for seamless UX. Cache availability data appropriately. Handle timezone conversions carefully. Let Gemini 3 generate booking flows from your scheduling requirements.

Google Antigravity excels at building complete scheduling integrations with proper error handling.

When to Use This Prompt

This Cal.com prompt is ideal for developers working on:

  • Cal.com applications requiring modern best practices and optimal performance
  • Projects that need production-ready Cal.com code with proper error handling
  • Teams looking to standardize their cal.com development workflow
  • Developers wanting to learn industry-standard Cal.com patterns and techniques

By using this prompt, you can save hours of manual coding and ensure best practices are followed from the start. It's particularly valuable for teams looking to maintain consistency across their cal.com implementations.

How to Use

  1. Copy the prompt - Click the copy button above to copy the entire prompt to your clipboard
  2. Paste into your AI assistant - Use with Claude, ChatGPT, Cursor, or any AI coding tool
  3. Customize as needed - Adjust the prompt based on your specific requirements
  4. Review the output - Always review generated code for security and correctness
💡 Pro Tip: For best results, provide context about your project structure and any specific constraints or preferences you have.

Best Practices

  • ✓ Always review generated code for security vulnerabilities before deploying
  • ✓ Test the Cal.com code in a development environment first
  • ✓ Customize the prompt output to match your project's coding standards
  • ✓ Keep your AI assistant's context window in mind for complex requirements
  • ✓ Version control your prompts alongside your code for reproducibility

Frequently Asked Questions

Can I use this Cal.com prompt commercially?

Yes! All prompts on Antigravity AI Directory are free to use for both personal and commercial projects. No attribution required, though it's always appreciated.

Which AI assistants work best with this prompt?

This prompt works excellently with Claude, ChatGPT, Cursor, GitHub Copilot, and other modern AI coding assistants. For best results, use models with large context windows.

How do I customize this prompt for my specific needs?

You can modify the prompt by adding specific requirements, constraints, or preferences. For Cal.com projects, consider mentioning your framework version, coding style, and any specific libraries you're using.

Related Prompts

💬 Comments

Loading comments...