Back
Cal.com Wrapper

Cal.com Wrapper

Overview

Cal.com Wrapper

Cal.com is an open source scheduling platform built for individuals and teams. It provides flexible, customizable scheduling infrastructure with support for round-robin routing, team availability, workflows, and integrations, with a mission to connect a billion people through calendar scheduling.

The Cal.com Wrapper brings your scheduling data into Postgres as queryable foreign tables. Query bookings, event types, calendars, schedules, and conferencing data with plain SQL and join them against your application data. Supports both read and write operations, and works with Supabase Vault for secure API key management and is built on WebAssembly (Wasm) for lightweight, sandboxed execution.

Preparation

Before you get started, make sure the wrappers extension is installed on your database:


_10
create extension if not exists wrappers with schema extensions;

and then enable the Wasm foreign data wrapper:


_10
create foreign data wrapper wasm_wrapper
_10
handler wasm_fdw_handler
_10
validator wasm_fdw_validator;

Secure your credentials (optional)

By default, Postgres stores FDW credentials inside pg_catalog.pg_foreign_server in plain text. Anyone with access to this table will be able to view these credentials. Wrappers is designed to work with Vault, which provides an additional level of security for storing credentials. We recommend using Vault to store your credentials.


_10
select vault.create_secret(
_10
'<Cal.com API key>',
_10
'cal',
_10
'Cal.com API key for Wrappers'
_10
);

Connecting to Cal.com

We need to provide Postgres with the credentials to access Cal.com, and any additional options. We can do this using the create server command:

With Vault:


_10
create server cal_server
_10
foreign data wrapper wasm_wrapper
_10
options (
_10
fdw_package_url 'https://github.com/supabase/wrappers/releases/download/wasm_cal_fdw_v0.2.0/cal_fdw.wasm',
_10
fdw_package_name 'supabase:cal-fdw',
_10
fdw_package_version '0.2.0',
_10
fdw_package_checksum 'c9d14036b370758ce75871d69e9c842bc922703d02323b73397995f4cf14491b',
_10
api_url 'https://api.cal.com/v2', -- optional
_10
api_key_id '<key_ID>' -- The Key ID from above.
_10
);

Without Vault:


_10
create server cal_server
_10
foreign data wrapper wasm_wrapper
_10
options (
_10
fdw_package_url 'https://github.com/supabase/wrappers/releases/download/wasm_cal_fdw_v0.2.0/cal_fdw.wasm',
_10
fdw_package_name 'supabase:cal-fdw',
_10
fdw_package_version '0.2.0',
_10
fdw_package_checksum 'c9d14036b370758ce75871d69e9c842bc922703d02323b73397995f4cf14491b',
_10
api_url 'https://api.cal.com/v2', -- optional
_10
api_key 'cal_live_1234...' -- Cal.com API key
_10
);

Note: the fdw_package_* options are required and specify the Wasm package metadata. See the Available Versions table above for the full list.

Resources

Details

DeveloperSupabase
DocumentationLearn

Third-party integrations and docs are managed by Supabase partners.

Get started with Cal.com Wrapper and Supabase.