Socket
Book a DemoInstallSign in
Socket

@restackio/integrations-calendly

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@restackio/integrations-calendly

This package provides an integration for Calendly's API, specifically tailored for use with the Restack AI framework.

0.0.2
latest
npmnpm
Version published
Weekly downloads
2
Maintainers
0
Weekly downloads
 
Created
Source

@restackio/integrations-calendly

This package provides an integration for Calendly's API, specifically tailored for use with the Restack AI framework.

Installation

To install the package, use npm or yarn:

npm install @restackio/integrations-calendly

Features

  • Calendly Scheduled Events Listing
  • Event Type Creation for Custom Workflows
  • Rate Limiting and Error Handling Support

Usage

Basic Setup

// services.ts
import Restack from "@restackio/ai";
import { calendlyService } from "@restackio/integrations-calendly";

export async function services() {
  const client = new Restack();
  calendlyService({ client }).catch((err) => {
    console.error("Error starting Calendly service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});

List Scheduled Events

To list scheduled events, you can use the listScheduledEvents function. This function corresponds to the Calendly API endpoint /scheduled_events, which accepts various filtering parameters.

// listScheduledEventsWorkflow.ts

import { log, step } from "@restackio/ai/workflow";
import * as calendlyFunctions from "@restackio/integrations-calendly/functions";
import { calendlyTaskQueue } from "@restackio/integrations-calendly/taskQueue";

export async function listScheduledEventsWorkflow() {
  const params = {
    user: "user_uri",
    count: 10,
    invitee_email: "example@domain.com",
    status: "active",
  };

  const events = await step<typeof calendlyFunctions>({
    taskQueue: calendlyTaskQueue,
  }).listScheduledEvents(params);

  log.info("Fetched scheduled events", { events });
}

Create Event Type

To create a new event type, use the createEventType function, which corresponds to the Calendly API endpoint /one_off_event_types. This function allows you to set up one-off event types tailored to specific workflows.

// createEventTypeWorkflow.ts

import { log, step } from "@restackio/ai/workflow";
import * as calendlyFunctions from "@restackio/integrations-calendly/functions";
import { calendlyTaskQueue } from "@restackio/integrations-calendly/taskQueue";

export async function createEventTypeWorkflow() {
  const eventTypeData = {
    name: "New Event Type",
    host: "https://api.calendly.com/users/your-user-id",
    duration: 30,
    timezone: "America/New_York",
    date_setting: {
      type: "date_range",
      start_date: "2024-12-01",
      end_date: "2024-12-31",
    },
    location: {
      kind: "physical",
      location: "Main Office",
      additional_info: "Check-in at the front desk",
    },
  };

  const createdEvent = await step<typeof calendlyFunctions>({
    taskQueue: calendlyTaskQueue,
  }).createEventType(eventTypeData);

  log.info("Created new event type", { eventName: createdEvent.name });
}

Configuration

This package uses environment variables for configuration. Ensure that you set up:

  • CALENDLY_API_KEY: Your Calendly API key

Additional Information

For more details on the API endpoints used in this integration, refer to the following documentation:

  • List Scheduled Events Endpoint
  • Create One-Off Event Type Endpoint

FAQs

Package last updated on 09 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.