Back
Calendly Wrapper

Calendly Wrapper

Overview

Calendly Wrapper

Calendly is a scheduling automation platform used by teams to schedule, prepare for, and follow up on external meetings. It removes the back-and-forth of finding meeting times and integrates with calendars, CRMs, and workflows across the stack.

The Calendly Wrapper brings your scheduling data into Postgres as queryable foreign tables. Query scheduled events, event types, organization memberships, and more with plain SQL and join them against your application data. All objects are read-only, and the wrapper works with Supabase Vault for secure token 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
'<Calendly API key>',
_10
'calendly',
_10
'Calendly API key for Wrappers'
_10
);

Connecting to Calendly

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

Note: the organization option requires your Calendly organization URI. You can retrieve this after connecting by querying the calendly.current_user table: select attrs->>'current_organization' as org_uri from calendly.current_user;

With Vault:


_11
create server calendly_server
_11
foreign data wrapper wasm_wrapper
_11
options (
_11
fdw_package_url 'https://github.com/supabase/wrappers/releases/download/wasm_calendly_fdw_v0.2.0/calendly_fdw.wasm',
_11
fdw_package_name 'supabase:calendly-fdw',
_11
fdw_package_version '0.2.0',
_11
fdw_package_checksum '1d18021cc3618440107b0d37f0a811607fdc863d9841a5da1ff9d56bc9f44df1',
_11
organization 'https://api.calendly.com/organizations/<your_org_id>',
_11
api_url 'https://api.calendly.com', -- optional
_11
api_key_id '<key_ID>' -- The Key ID from above.
_11
);

Without Vault:


_11
create server calendly_server
_11
foreign data wrapper wasm_wrapper
_11
options (
_11
fdw_package_url 'https://github.com/supabase/wrappers/releases/download/wasm_calendly_fdw_v0.2.0/calendly_fdw.wasm',
_11
fdw_package_name 'supabase:calendly-fdw',
_11
fdw_package_version '0.2.0',
_11
fdw_package_checksum '1d18021cc3618440107b0d37f0a811607fdc863d9841a5da1ff9d56bc9f44df1',
_11
organization 'https://api.calendly.com/organizations/<your_org_id>',
_11
api_url 'https://api.calendly.com', -- optional
_11
api_key 'eyJraWQiOiIxY2UxZ...' -- Calendly personal access token
_11
);

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 Calendly Wrapper and Supabase.