Introduction
Start integrating Recal's API with TypeScript
Getting Started
The Recal JavaScript SDK is an open-source software development kit for interacting with the Recal API using JavaScript and TypeScript. Build sophisticated calendar integrations with support for Google Calendar and Microsoft Outlook.
Security note: This SDK is designed for server-side use. Never expose your API token in client-side code.
Features
- Multi-Provider Support: Seamlessly work with Google Calendar and Microsoft Outlook
- Type Safety: Full TypeScript support with runtime validation
- Rich Calendar Operations: Events, busy queries, scheduling, and more
- Organization Management: Handle organization and user calendars
- OAuth Integration: Built-in OAuth flow support for calendar connections
- Error Handling: Comprehensive error types for robust applications
- Modern Architecture: Clean, testable service-based design
Setup
Create an Account & Get API Key
- Sign up for a Recal account
- Log in to your Recal dashboard
- Navigate to "API Keys" in the sidebar
- Create a new API key and copy it to a secure location
Set Up OAuth Providers
- Go to "OAuth Credentials" in the sidebar
- Enter your OAuth Client ID and Secret
- Save your credentials
To get the client ID and secret for each provider, follow the guides below:
Install the SDK
Choose your preferred package manager to install the Recal SDK:
# npm
npm install recal-sdk
# bun
bun add recal-sdk
# yarn
yarn add recal-sdkInitialize the SDK
Import and initialize the SDK with your API key:
import { Recal } from 'recal-sdk';
const recal = new Recal({
token: "<RECAL_TOKEN>"
});You can also use environment variables:
// Reads from process.env.RECAL_TOKEN
const recal = new Recal();Note: RecalClient is available as an alias for backward compatibility, but Recal is the recommended import.
Test Your Connection
import { Recal } from 'recal-sdk';
const recal = new Recal({
token: "<RECAL_TOKEN>"
});
const orgs = await recal.organizations.list();
console.log(orgs); // should log [] if you have no organizationsContribute to the SDK
The Recal Node.js SDK repository contains the Node.js SDK. You can contribute to the SDK by creating an issue or opening a pull request.