@boringos/connector-google
v0.2.13
Published
Google Workspace connector for Gmail and Calendar
Maintainers
Readme
@boringos/connector-google
Google Workspace connector for BoringOS -- Gmail and Calendar integration with OAuth.
Install
npm install @boringos/connector-googleUsage
import { BoringOS } from "@boringos/core";
import { google } from "@boringos/connector-google";
const app = new BoringOS({});
app.connector(
google({
clientId: process.env.GOOGLE_CLIENT_ID!,
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
})
);
await app.listen(3000);Direct Client Usage
import { GmailClient, CalendarClient } from "@boringos/connector-google";
const gmail = new GmailClient(credentials);
const emails = await gmail.listEmails({ maxResults: 10 });
const email = await gmail.readEmail(emailId);
await gmail.sendEmail({ to: "[email protected]", subject: "Hello", body: "..." });
const calendar = new CalendarClient(credentials);
const events = await calendar.listEvents({ timeMin: new Date() });
await calendar.createEvent({ summary: "Meeting", start, end });
const slots = await calendar.findFreeSlots({ timeMin, timeMax, duration: 30 });API Reference
Connector
| Export | Description |
|---|---|
| google(config) | Google Workspace connector definition |
Gmail Actions
| Action | Description |
|---|---|
| list_emails | List recent emails |
| read_email | Read a specific email |
| send_email | Send an email |
| search_emails | Search with Gmail query syntax |
Calendar Actions
| Action | Description |
|---|---|
| list_events | List calendar events |
| create_event | Create a new event |
| update_event | Update an existing event |
| find_free_slots | Find available time slots |
Events
email_received, calendar_event_created, calendar_event_updated
Types
GoogleConfig, GmailClient, CalendarClient
