### Run Examples App
Source: https://github.com/calcom/cal.diy/blob/main/apps/api/v2/README-PLATFORM.md
Navigate to the examples base directory and run this command to start the examples app. Access it at localhost:4321.
```bash
cd packages/platform/examples/base
yarn dev
```
--------------------------------
### Setup Examples App SQLite Database
Source: https://github.com/calcom/cal.diy/blob/main/apps/api/v2/README-PLATFORM.md
Navigate to the examples base directory, remove the existing database file, and push the schema to set up the SQLite database.
```bash
cd packages/platform/examples/base
rm -f prisma/dev.db && yarn prisma db push
```
--------------------------------
### Install Dependencies and Set Up Environment
Source: https://github.com/calcom/cal.diy/blob/main/agents/rules/reference-local-dev.md
Install project dependencies using yarn and copy the example environment file to .env.
```bash
# Install dependencies
yarn
# Set up environment
cp .env.example .env
```
--------------------------------
### Copy Environment Example
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Copy the example environment file to .env to start configuring your deployment. This file contains all necessary runtime variables.
```bash
cp .env.example .env
```
--------------------------------
### Start Docker Service
Source: https://github.com/calcom/cal.diy/blob/main/apps/docs/content/deployments/gcp.mdx
Command to start the Docker service after installation. This ensures Docker is running and ready to manage containers.
```bash
sudo systemctl start docker
```
--------------------------------
### Build and Start Production Server
Source: https://github.com/calcom/cal.diy/blob/main/apps/docs/content/upgrading.mdx
Create a production build and then start the server for a production environment.
```bash
yarn build
yarn start
```
--------------------------------
### Build and Start Production
Source: https://github.com/calcom/cal.diy/blob/main/apps/docs/content/installation.mdx
After setting up environment variables and upgrading the database, use these commands to build the production-ready application and start the server.
```bash
yarn build
yarn start
```
--------------------------------
### Platform Authentication - Example Request
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/authentication.md
Demonstrates how to make a GET request to the /v2/bookings endpoint using Platform Authentication headers.
```APIDOC
## Platform Authentication - Example Request
### Description
This example shows how to authenticate requests when acting on behalf of a managed user using platform-specific headers.
### Method
GET
### Endpoint
/v2/bookings
### Headers
- **x-cal-client-id** (string) - Required - Your OAuth client ID
- **x-cal-secret-key** (string) - Required - Your OAuth client secret key
- **Authorization** (string) - Required - Bearer token for the managed user's access token
- **Content-Type** (string) - Required - `application/json`
### Request Example
```bash
curl -X GET "https://api.cal.com/v2/bookings" \
-H "x-cal-client-id: your_client_id" \
-H "x-cal-secret-key: your_secret_key" \
-H "Authorization: Bearer managed_user_access_token" \
-H "Content-Type: application/json"
```
```
--------------------------------
### Start Development Server
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Run this command to start the Cal.com development server.
```sh
yarn dev
```
--------------------------------
### Start Development Server
Source: https://github.com/calcom/cal.diy/blob/main/agents/commands.md
Use `yarn dev` to start the development server for the web app. For a full development environment including website and console, use `yarn dev:all`. To include API proxy and API, use `yarn dev:api`. For console-specific development, use `yarn dev:console`. For development with database setup, use `yarn dx`.
```bash
yarn dev
```
```bash
yarn dev:all
```
```bash
yarn dev:api
```
```bash
yarn dev:console
```
```bash
yarn dx
```
--------------------------------
### API Key Authentication - Example Request
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/authentication.md
Demonstrates how to make a GET request to the /v2/bookings endpoint using API Key authentication.
```APIDOC
## GET /v2/bookings
### Description
This endpoint retrieves a list of bookings. Authentication is required using an API key.
### Method
GET
### Endpoint
/v2/bookings
### Headers
- **Authorization** (string) - Required - Bearer token with your API key (e.g., `Bearer cal_live_abc123xyz`)
- **Content-Type** (string) - Required - `application/json`
### Request Example
```bash
curl -X GET "https://api.cal.com/v2/bookings" \
-H "Authorization: Bearer cal_live_abc123xyz789" \
-H "Content-Type: application/json"
```
```
--------------------------------
### Start Production Server
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Run this command to start the Cal.com server in a production environment after building.
```sh
yarn start
```
--------------------------------
### Install Dependencies
Source: https://github.com/calcom/cal.diy/blob/main/apps/api/v2/README.md
Run this command in your terminal to install all necessary project dependencies.
```bash
$ yarn install
```
--------------------------------
### Basic Setup and Usage
Source: https://github.com/calcom/cal.diy/blob/main/packages/features/data-table/GUIDE.md
Demonstrates the basic setup for a data table, including defining data types, columns with filtering, and initializing the table with provider and wrapper components.
```APIDOC
## Basic Setup
This section outlines the fundamental steps to integrate and configure the data table components.
### 1. Define Data Type
Define the structure of your data objects.
```tsx
type User = {
id: number;
name: string;
email: string;
role: string;
};
```
### 2. Create Columns
Define the columns for your table, including filtering configurations.
```tsx
import { ColumnFilterType } from "@calcom/features/data-table";
const columns = [
{
id: "name",
header: "Name",
accessorKey: "name",
meta: {
type: ColumnFilterType.TEXT,
},
},
{
id: "role",
header: "Role",
accessorKey: "role",
meta: {
type: ColumnFilterType.SINGLE_SELECT,
},
},
];
```
### 3. Setup the Table Component
Integrate `DataTableProvider` and `DataTableWrapper` to manage state and render the table.
```tsx
import { DataTableProvider } from "~/data-table/DataTableProvider";
import { useDataTable } from "~/data-table/hooks/useDataTable";
import { DataTableWrapper } from "~/data-table/components/DataTableWrapper";
import { DataTableFilters } from "~/data-table/components/filters";
import { usePathname } from "next/navigation"; // Assuming Next.js
import { useReactTable } from "@tanstack/react-table"; // Assuming TanStack Table
// Assume 'users' is your data array and 'useReactTable' is imported
// const users: User[] = [...];
// const table = useReactTable({ data: users, columns, ... });
function UserTable() {
const pathname = usePathname();
const tableIdentifier = "hard-coded idenfidier"; // or pathname;
return (
>
}
ToolbarRight={
<>
>
}
/>
);
}
```
```
--------------------------------
### Start API v2
Source: https://github.com/calcom/cal.diy/blob/main/apps/api/v2/README-PLATFORM.md
Navigate to the v2 API directory and run these commands to start the API. This is useful if the v2 API restarts unexpectedly.
```bash
cd apps/api/v2
yarn dev:build
yarn start
```
--------------------------------
### Install Dependencies
Source: https://github.com/calcom/cal.diy/blob/main/apps/docs/content/installation.mdx
Navigate to the cloned directory and run this command to install all necessary project dependencies using Yarn.
```bash
cd cal.diy
yarn
```
--------------------------------
### Install Project Dependencies
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Install all necessary project packages using Yarn.
```sh
yarn
```
--------------------------------
### Create Booking Response Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/bookings.md
Example JSON response after successfully creating a booking. It returns the created booking's details.
```json
{
"status": "success",
"data": {
"id": 12345,
"uid": "abc123def456",
"title": "30 Minute Meeting",
"start": "2024-01-15T10:00:00.000Z",
"end": "2024-01-15T10:30:00.000Z",
"status": "accepted",
"eventTypeId": 123,
"attendees": [...],
"hosts": [...],
"location": "https://cal.com/video/abc123"
}
}
```
--------------------------------
### Install Stripe CLI with Homebrew
Source: https://github.com/calcom/cal.diy/blob/main/packages/platform/atoms/STRIPE.md
Installs the Stripe CLI using Homebrew. Ensure Homebrew is installed and updated before running this command.
```sh
brew install stripe/stripe-cli/stripe
```
--------------------------------
### Configure Environment Variables for Examples App
Source: https://github.com/calcom/cal.diy/blob/main/packages/platform/examples/base/README-OAUTH2.MD
Set up the necessary environment variables in the `.env` file for the examples app to run with OAuth 2.0. Ensure `NEXT_PUBLIC_OAUTH2_MODE` is set to `true`.
```env
NEXT_PUBLIC_OAUTH2_CLIENT_ID="1c70be53f35aa480a5e3146d361fd993d265e564d2d86a203df3adbd05186517"
OAUTH2_CLIENT_SECRET_PLAIN="2df0d9b1450ea95f2376fce5bc1d352e2d7a253d7e1c68a96a44745413b7dc4c"
OAUTH2_REDIRECT_URI="http://localhost:4321"
NEXT_PUBLIC_CALCOM_API_URL="http://localhost:5555/api/v2"
NEXT_PUBLIC_OAUTH2_MODE="true"
```
--------------------------------
### Start Local Database with Docker Compose
Source: https://github.com/calcom/cal.diy/blob/main/README.md
If a local database is required for the build process, start it using Docker Compose. This command starts the database service in detached mode.
```bash
docker compose up -d database
```
--------------------------------
### Basic Data Table Setup with React
Source: https://github.com/calcom/cal.diy/blob/main/packages/features/data-table/GUIDE.md
Demonstrates the basic setup for a data table using React, including defining data types, columns with filtering, and integrating the DataTableProvider and DataTableWrapper. Ensure necessary imports from @calcom/features/data-table and ~/data-table are present.
```tsx
// Types and utilities stay in @calcom/features/data-table
import { ColumnFilterType } from "@calcom/features/data-table";
// Hooks, contexts, and providers are in apps/web/modules/data-table
// (use ~/data-table/... imports within apps/web)
import { DataTableProvider } from "~/data-table/DataTableProvider";
import { useDataTable } from "~/data-table/hooks/useDataTable";
// UI components are in apps/web/modules/data-table/components
import { DataTableWrapper } from "~/data-table/components/DataTableWrapper";
import { DataTableFilters } from "~/data-table/components/filters";
// 1. Define your data type
type User = {
id: number;
name: string;
email: string;
role: string;
};
// 2. Create columns with filtering support
const columns = [
{
id: "name",
header: "Name",
accessorKey: "name",
meta: {
type: ColumnFilterType.TEXT,
},
},
{
id: "role",
header: "Role",
accessorKey: "role",
meta: {
type: ColumnFilterType.SINGLE_SELECT,
},
},
];
// 3. Setup the table
function UserTable() {
const table = useReactTable({
data: users,
columns,
// ... other table options
});
const pathname = usePathname();
const tableIdentifier = "hard-coded idenfidier"; // or pathname;
return (
>
}
ToolbarRight={
<>
>
}
/>
);
}
```
--------------------------------
### Select (Dropdown) Booking Field Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/event-types.md
Example JSON for a select (dropdown) booking field with options.
```json
{
"type": "select",
"name": "topic",
"label": "Meeting Topic",
"required": true,
"options": [
{ "value": "sales", "label": "Sales Inquiry" },
{ "value": "support", "label": "Support" },
{ "value": "other", "label": "Other" }
]
}
```
--------------------------------
### Start API v2 in Development Mode
Source: https://github.com/calcom/cal.diy/blob/main/apps/api/v2/README.md
Run this command to start the API v2 development server. It includes watch mode for automatic restarts on code changes.
```bash
$ yarn dev
```
--------------------------------
### Install E2E Test Browsers
Source: https://github.com/calcom/cal.diy/blob/main/CONTRIBUTING.md
Run 'npx playwright install' to download necessary test browsers and resolve 'Executable doesn't exist' errors when running 'yarn test-e2e'.
```bash
npx playwright install
```
--------------------------------
### List Bookings Response Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/bookings.md
Example JSON response when listing bookings. Includes details for each booking such as ID, UID, title, start/end times, status, attendees, and hosts.
```json
{
"status": "success",
"data": [
{
"id": 12345,
"uid": "abc123def456",
"title": "30 Minute Meeting",
"description": "Discussion about project",
"start": "2024-01-15T10:00:00.000Z",
"end": "2024-01-15T10:30:00.000Z",
"status": "accepted",
"eventTypeId": 123,
"attendees": [
{
"name": "John Doe",
"email": "john@example.com",
"timeZone": "America/New_York"
}
],
"hosts": [
{
"id": 456,
"name": "Jane Smith",
"email": "jane@company.com"
}
],
"location": "https://cal.com/video/abc123",
"meetingUrl": "https://cal.com/video/abc123",
"metadata": {},
"createdAt": "2024-01-10T08:00:00.000Z"
}
]
}
```
--------------------------------
### Get Busy Times Response
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/calendars.md
Example JSON response for the Get Busy Times endpoint, listing busy periods with start and end times, title, and source integration.
```json
{
"status": "success",
"data": [
{
"start": "2024-01-15T10:00:00.000Z",
"end": "2024-01-15T11:00:00.000Z",
"title": "Team Meeting",
"source": "google_calendar"
},
{
"start": "2024-01-16T14:00:00.000Z",
"end": "2024-01-16T15:00:00.000Z",
"title": "Client Call",
"source": "google_calendar"
}
]
}
```
--------------------------------
### Start MailHog for Local Email Testing
Source: https://github.com/calcom/cal.diy/blob/main/apps/api/v2/README.md
Navigate to the emails package and run this command to start MailHog, which is used by API v2 for local email sending.
```bash
$ cd packages/emails && yarn dx
```
--------------------------------
### Get Busy Times Example Request
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/calendars.md
Example HTTP request to the Get Busy Times endpoint, specifying a date range and user timezone.
```http
GET /v2/calendars/busy-times?startTime=2024-01-15T00:00:00Z&endTime=2024-01-22T00:00:00Z&loggedInUsersTz=America/New_York
```
--------------------------------
### Navigate to Project Directory
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Change into the cloned project directory to begin setup.
```sh
cd cal.diy
```
--------------------------------
### Example JSON for Manual OAuth 2.0 Client Creation
Source: https://github.com/calcom/cal.diy/blob/main/apps/api/v2/README-PLATFORM.md
JSON object for a manually created OAuth 2.0 client. Ensure the redirectUri matches the examples app's running address (e.g., http://localhost:4321).
```json
{
"clientId": "1c70be53f35aa480a5e3146d361fd993d265e564d2d86a203df3adbd05186517",
"redirectUri": "http://localhost:4321",
"clientSecret": "970db2cf14112013ba3a510b945294fef8737d42ee58c32031d2351692068ce7",
"name": "atoms examples app oauth 2 client",
"logo": null,
"clientType": "confidential",
"isTrusted": false,
"createdAt": "2026-01-27 09:35:26.731",
"purpose": "test atoms examples app with oauth 2",
"rejectionReason": null,
"status": "approved",
"userId": 10,
"websiteUrl": "http://localhost:4321"
}
```
--------------------------------
### Curl Request with Platform Authentication
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/authentication.md
Example of a GET request to the /v2/bookings endpoint using platform authentication headers.
```bash
curl -X GET "https://api.cal.com/v2/bookings" \
-H "x-cal-client-id: your_client_id" \
-H "x-cal-secret-key: your_secret_key" \
-H "Authorization: Bearer managed_user_access_token" \
-H "Content-Type: application/json"
```
--------------------------------
### Open Cal.diy in Gitpod
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Launch a fully configured development environment in your browser by clicking the Gitpod button. All necessary dependencies are pre-installed.
```sh
https://gitpod.io/#https://github.com/calcom/cal.diy
```
--------------------------------
### Start Cal.diy with Docker Compose (Web App & Studio)
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Run only the Cal.diy web app and Prisma Studio, connecting to a remote database. Configure DATABASE_URL in your .env file.
```bash
docker compose up -d calcom studio
```
--------------------------------
### Curl Request with API Key
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/authentication.md
Example of how to make a GET request to the /v2/bookings endpoint using an API key.
```bash
curl -X GET "https://api.cal.com/v2/bookings" \
-H "Authorization: Bearer cal_live_abc123xyz789" \
-H "Content-Type: application/json"
```
--------------------------------
### Quick Start with Docker Compose
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Launch a local PostgreSQL instance with test users using `yarn dx`. Requires Docker and Docker Compose. Credentials will be logged to the console.
```sh
yarn dx
```
--------------------------------
### Paginate API Results
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/authentication.md
This HTTP GET request example shows how to use the `take` and `skip` query parameters to paginate through list endpoints, retrieving a specific range of items.
```http
GET /v2/bookings?take=20&skip=40
```
--------------------------------
### Copy Environment Files
Source: https://github.com/calcom/cal.diy/blob/main/apps/docs/content/installation.mdx
Copy the example environment files to create your active configuration files for both the API and the main application.
```bash
cp apps/api/v2/.env.example apps/api/v2/.env
cp .env.example .env
```
--------------------------------
### Start Cal.diy with Docker Compose (Full Stack)
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Run the complete Cal.diy stack, including the web app, database, and Prisma Studio, in detached mode. Ensure your .env file is configured.
```bash
docker compose up -d
```
--------------------------------
### Incorrect API Change: Renaming a Field
Source: https://github.com/calcom/cal.diy/blob/main/agents/rules/api-no-breaking-changes.md
Avoid renaming existing fields in API responses as it constitutes a breaking change. This example shows a TypeScript interface where renaming `startTime` to `start` would break existing clients.
```typescript
// v1 - Original response
interface BookingResponse {
id: number;
startTime: string; // ISO string
}
// v1 - Breaking change: renamed field
interface BookingResponse {
id: number;
start: string; // Renamed from startTime - BREAKS CLIENTS
}
```
--------------------------------
### Create Booking HTTP Request
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/SKILL.md
Send a POST request to create a new booking. Ensure the `Content-Type` header is set to `application/json`. This example includes the start time, event type ID, and attendee details. Refer to `references/bookings.md` for all booking operations.
```http
POST /v2/bookings
Content-Type: application/json
{
"start": "2024-01-15T10:00:00Z",
"eventTypeId": 123,
"attendee": {
"name": "John Doe",
"email": "john@example.com",
"timeZone": "America/New_York"
}
}
```
--------------------------------
### Database Setup for Development and Production
Source: https://github.com/calcom/cal.diy/blob/main/agents/rules/reference-local-dev.md
Run database migrations for the development environment or deploy for production using the Prisma workspace.
```bash
# Development
yarn workspace @calcom/prisma db-migrate
# Production
yarn workspace @calcom/prisma db-deploy
```
--------------------------------
### Correct API Evolution: Adding an Optional Field
Source: https://github.com/calcom/cal.diy/blob/main/agents/rules/api-no-breaking-changes.md
To evolve an API without breaking changes, add new fields as optional or alongside existing ones. This TypeScript example demonstrates adding a new `start` field while retaining the original `startTime` for backward compatibility.
```typescript
// v1 - Original response
interface BookingResponse {
id: number;
startTime: string;
}
// v1 - Non-breaking: add new field, keep old one
interface BookingResponse {
id: number;
startTime: string; // Keep for backwards compatibility
start: string; // New preferred field
}
```
--------------------------------
### Create Basic App
Source: https://github.com/calcom/cal.diy/blob/main/packages/app-store-cli/SAMPLE_COMMANDS.md
This command creates a minimal, installable app. It serves as a basic template with no additional features.
```bash
yarn app-store create \
--name "My Basic App" \
--description "A simple installable app" \
--template basic \
--category other \
--publisher "Cal.com, Inc." \
--email "support@cal.com"
```
--------------------------------
### Start Cal.diy with Docker Compose (Web App Only)
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Run only the Cal.diy web app, connecting to a remote database. Configure DATABASE_URL in your .env file.
```bash
docker compose up -d calcom
```
--------------------------------
### Update Schedule Request Body Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/schedules.md
Example JSON payload for updating a schedule. This example modifies the schedule's name and its working hours.
```json
{
"name": "Updated Schedule Name",
"availability": [
{
"days": [1, 2, 3, 4, 5],
"startTime": "08:00",
"endTime": "18:00"
}
]
}
```
--------------------------------
### Install Dependencies with Yarn
Source: https://github.com/calcom/cal.diy/blob/main/apps/docs/content/deployments/vercel.mdx
Installs all necessary project packages using Yarn. If encountering issues on Vercel, consider using `YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install`.
```bash
yarn install
```
--------------------------------
### Setup Prisma and Seed Database
Source: https://github.com/calcom/cal.diy/blob/main/apps/api/v2/README.md
Commands to generate Prisma client, apply database migrations, and seed the database. These are optional steps if you need to set up the database.
```bash
$ cd packages/prisma
$ yarn prisma generate
$ yarn prisma migrate dev
$ yarn db-seed
```
--------------------------------
### Deploy Database (Production)
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Run this command to set up the database using the Prisma schema in a production environment.
```sh
yarn workspace @calcom/prisma db-deploy
```
--------------------------------
### Webhook Payload Examples
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/webhooks.md
Examples of webhook payloads for different event triggers.
```APIDOC
## Webhook Payload Examples
### Description
Provides example JSON payloads for various webhook trigger events.
### BOOKING_CREATED Payload
```json
{
"triggerEvent": "BOOKING_CREATED",
"createdAt": "2024-01-15T10:00:00.000Z",
"payload": {
"type": "30min",
"title": "30 Minute Meeting",
"description": "Meeting description",
"startTime": "2024-01-15T10:00:00.000Z",
"endTime": "2024-01-15T10:30:00.000Z",
"organizer": {
"id": 123,
"name": "Jane Smith",
"email": "jane@company.com",
"timeZone": "America/New_York"
},
"attendees": [
{
"name": "John Doe",
"email": "john@example.com",
"timeZone": "America/New_York"
}
],
"location": "https://cal.com/video/abc123",
"destinationCalendar": {
"integration": "google_calendar",
"externalId": "calendar-id"
},
"uid": "booking-uid-123",
"metadata": {},
"responses": {
"name": "John Doe",
"email": "john@example.com"
}
}
}
```
### BOOKING_CANCELLED Payload
```json
{
"triggerEvent": "BOOKING_CANCELLED",
"createdAt": "2024-01-15T12:00:00.000Z",
"payload": {
"uid": "booking-uid-123",
"title": "30 Minute Meeting",
"startTime": "2024-01-15T10:00:00.000Z",
"endTime": "2024-01-15T10:30:00.000Z",
"cancellationReason": "Schedule conflict",
"organizer": {...},
"attendees": [...]
}
}
```
### BOOKING_RESCHEDULED Payload
```json
{
"triggerEvent": "BOOKING_RESCHEDULED",
"createdAt": "2024-01-15T11:00:00.000Z",
"payload": {
"uid": "new-booking-uid",
"rescheduleUid": "original-booking-uid",
"title": "30 Minute Meeting",
"startTime": "2024-01-16T14:00:00.000Z",
"endTime": "2024-01-16T14:30:00.000Z",
"reschedulingReason": "Conflict with another meeting",
"organizer": {...},
"attendees": [...]
}
}
```
```
--------------------------------
### Textarea Booking Field Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/event-types.md
Example JSON for a textarea booking field.
```json
{
"type": "textarea",
"name": "notes",
"label": "Additional Notes",
"required": false
}
```
--------------------------------
### Configure Environment Variables
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Set up the .env file by duplicating the example and generating necessary secret keys for NextAuth and Calendso encryption.
```sh
openssl rand -base64 32
```
```sh
openssl rand -base64 24
```
--------------------------------
### Text Field Booking Field Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/event-types.md
Example JSON for a text input booking field.
```json
{
"type": "text",
"name": "company",
"label": "Company Name",
"required": true,
"placeholder": "Enter your company name"
}
```
--------------------------------
### Build Local Platform Libraries
Source: https://github.com/calcom/cal.diy/blob/main/packages/platform/libraries/README.md
Run this command the first time you change platform libraries to build them locally and point the v2 API to your local versions.
```bash
yarn local
```
--------------------------------
### Get a Webhook (HTTP GET)
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/webhooks.md
Use this endpoint to retrieve details for a specific webhook by its ID.
```http
GET /v2/webhooks/{webhookId}
```
--------------------------------
### Example Migration File Location and Naming
Source: https://github.com/calcom/cal.diy/blob/main/agents/rules/data-prisma-feature-flags.md
Migration files for feature flags should be placed in the `packages/prisma/migrations/` directory and follow a specific timestamped naming convention.
```text
20250724210733_seed_calendar_cache_sql_features/migration.sql
```
--------------------------------
### Get a Booking GET Request
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/bookings.md
Retrieve a specific booking using its unique identifier (`bookingUid`).
```http
GET /v2/bookings/{bookingUid}
```
--------------------------------
### Phone Number Booking Field Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/event-types.md
Example JSON for a phone number input booking field.
```json
{
"type": "phone",
"name": "phone",
"label": "Phone Number",
"required": false
}
```
--------------------------------
### Checkbox Booking Field Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/event-types.md
Example JSON for a checkbox booking field, typically used for agreements.
```json
{
"type": "checkbox",
"name": "terms",
"label": "I agree to the terms",
"required": true
}
```
--------------------------------
### Create Salesforce Scratch Org
Source: https://github.com/calcom/cal.diy/blob/main/packages/app-store/salesforce/README.md
Use this command to create a new Salesforce scratch org. Ensure the Salesforce CLI is installed and the configuration is specified in `project-scratch-def.json`.
```bash
yarn scratch-org:create
```
--------------------------------
### Radio Buttons Booking Field Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/event-types.md
Example JSON for a radio button group booking field with options.
```json
{
"type": "radio",
"name": "preference",
"label": "Preferred Contact Method",
"required": true,
"options": [
{ "value": "email", "label": "Email" },
{ "value": "phone", "label": "Phone" }
]
}
```
--------------------------------
### Update implementation.md Example
Source: https://github.com/calcom/cal.diy/blob/main/SPEC-WORKFLOW.md
After completing each piece of work, update `implementation.md` to reflect the current status, completed tasks, and next steps.
```markdown
## Status: in-progress
## Completed
- [x] Database schema
- [x] Migration file
## In Progress
- tRPC endpoints
## Next Steps
1. UI components
2. Tests
## Session Notes
### 2024-01-15
- Done: Added schema, created migration
- Next: Implement tRPC router
```
--------------------------------
### Deploy SFDC Package Preview
Source: https://github.com/calcom/cal.diy/blob/main/packages/app-store/salesforce/README.md
Use this command to preview changes before deploying them to the scratch org. Requires Salesforce CLI installation.
```bash
yarn sfdc:deploy:preview
```
--------------------------------
### BOOKING_RESCHEDULED Payload Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/webhooks.md
Example JSON payload received when a booking is rescheduled. Includes details of the new and original booking.
```json
{
"triggerEvent": "BOOKING_RESCHEDULED",
"createdAt": "2024-01-15T11:00:00.000Z",
"payload": {
"uid": "new-booking-uid",
"rescheduleUid": "original-booking-uid",
"title": "30 Minute Meeting",
"startTime": "2024-01-16T14:00:00.000Z",
"endTime": "2024-01-16T14:30:00.000Z",
"reschedulingReason": "Conflict with another meeting",
"organizer": {...},
"attendees": [...]
}
}
```
--------------------------------
### BOOKING_CANCELLED Payload Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/webhooks.md
Example JSON payload received when a booking is cancelled. Includes booking details and the reason for cancellation.
```json
{
"triggerEvent": "BOOKING_CANCELLED",
"createdAt": "2024-01-15T12:00:00.000Z",
"payload": {
"uid": "booking-uid-123",
"title": "30 Minute Meeting",
"startTime": "2024-01-15T10:00:00.000Z",
"endTime": "2024-01-15T10:30:00.000Z",
"cancellationReason": "Schedule conflict",
"organizer": {...},
"attendees": [...]
}
}
```
--------------------------------
### BOOKING_CREATED Payload Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/webhooks.md
Example JSON payload received when a booking is created. Includes details about the booking, organizer, and attendees.
```json
{
"triggerEvent": "BOOKING_CREATED",
"createdAt": "2024-01-15T10:00:00.000Z",
"payload": {
"type": "30min",
"title": "30 Minute Meeting",
"description": "Meeting description",
"startTime": "2024-01-15T10:00:00.000Z",
"endTime": "2024-01-15T10:30:00.000Z",
"organizer": {
"id": 123,
"name": "Jane Smith",
"email": "jane@company.com",
"timeZone": "America/New_York"
},
"attendees": [
{
"name": "John Doe",
"email": "john@example.com",
"timeZone": "America/New_York"
}
],
"location": "https://cal.com/video/abc123",
"destinationCalendar": {
"integration": "google_calendar",
"externalId": "calendar-id"
},
"uid": "booking-uid-123",
"metadata": {},
"responses": {
"name": "John Doe",
"email": "john@example.com"
}
}
}
```
--------------------------------
### Navigate to SFDC Package Directory
Source: https://github.com/calcom/cal.diy/blob/main/packages/app-store/salesforce/README.md
Change directory to the `sfdc-package` to run publishing commands.
```bash
cd packages/app-store/salesforce/sfdc-package
```
--------------------------------
### Initiate Feature Development with Claude
Source: https://github.com/calcom/cal.diy/blob/main/specs/README.md
After setting up the feature's spec folder, use this prompt to instruct Claude to review the codebase and fill in the design document.
```bash
"I want to build {feature}. Here's my idea: [description].
Review the codebase and fill in specs/{feature}/design.md"
```
--------------------------------
### Create Webhook Request Body Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/webhooks.md
Example JSON payload for creating a webhook, specifying the URL, triggers, and other configuration options.
```json
{
"subscriberUrl": "https://your-app.com/webhook",
"triggers": ["BOOKING_CREATED", "BOOKING_CANCELLED", "BOOKING_RESCHEDULED"],
"active": true,
"payloadTemplate": null,
"secret": "your-webhook-secret"
}
```
--------------------------------
### Configure API v2 Environment Variables
Source: https://github.com/calcom/cal.diy/blob/main/apps/api/v2/README.md
Copy the example environment file and set the NEXTAUTH_SECRET. Ensure NEXTAUTH_SECRET is consistent between the root .env and apps/api/v2/.env.
```bash
CALCOM_LICENSE_KEY="00000000-0000-0000-0000-000000000000"
```
--------------------------------
### Create Schedule Request Body Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/schedules.md
Example JSON payload for creating a schedule. It includes basic availability and a date override for a holiday.
```json
{
"name": "Working Hours",
"timeZone": "America/New_York",
"isDefault": true,
"availability": [
{
"days": [1, 2, 3, 4, 5],
"startTime": "09:00",
"endTime": "17:00"
}
],
"dateOverrides": [
{
"date": "2024-12-25",
"startTime": null,
"endTime": null
}
]
}
```
--------------------------------
### Build for Production
Source: https://github.com/calcom/cal.diy/blob/main/README.md
Compile the project for a production environment.
```sh
yarn build
```
--------------------------------
### List Webhooks Response Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/webhooks.md
Example JSON response when listing webhooks, showing details like ID, URL, triggers, and status.
```json
{
"status": "success",
"data": [
{
"id": "webhook-id-123",
"subscriberUrl": "https://your-app.com/webhook",
"triggers": ["BOOKING_CREATED", "BOOKING_CANCELLED"],
"active": true,
"payloadTemplate": null,
"secret": "whsec_..."
}
]
}
```
--------------------------------
### List Event Types Response Example
Source: https://github.com/calcom/cal.diy/blob/main/agents/skills/calcom-api/references/event-types.md
Example JSON response when listing event types, showing the structure of a single event type.
```json
{
"status": "success",
"data": [
{
"id": 123,
"title": "30 Minute Meeting",
"slug": "30min",
"description": "A quick 30 minute call",
"lengthInMinutes": 30,
"locations": [
{
"type": "integration",
"integration": "cal-video"
}
],
"bookingFields": [],
"disableGuests": false,
"slotInterval": null,
"minimumBookingNotice": 120,
"beforeEventBuffer": 0,
"afterEventBuffer": 0,
"schedulingType": null,
"metadata": {},
"requiresConfirmation": false,
"price": 0,
"currency": "usd",
"hidden": false
}
]
}
```
--------------------------------
### Create General App Settings
Source: https://github.com/calcom/cal.diy/blob/main/packages/app-store-cli/SAMPLE_COMMANDS.md
This command creates an app with global settings accessible in the installed apps section. It's useful for apps like 'Weather in your Calendar'.
```bash
yarn app-store create \
--name "My Settings App" \
--description "An app with global configuration settings" \
--template general-app-settings \
--category other \
--publisher "Cal.com, Inc." \
--email "support@cal.com"
```
--------------------------------
### Deploy SFDC Package
Source: https://github.com/calcom/cal.diy/blob/main/packages/app-store/salesforce/README.md
Command to deploy Apex changes to the scratch org. Ensure 'Named Credential' is correctly configured to point to your local development instance if necessary.
```bash
yarn sfdc:deploy
```