Calendar code you can read
@pyas/sdk gives you Google Calendar, Outlook and Zoom as typed methods for Node.js and TypeScript. The pyas CLI does the same from your terminal, forwards webhooks to your laptop and starts you with an app that already works.
npm install @pyas/sdkimport { Pyas } from '@pyas/sdk'
const pyas = new Pyas({ apiKey: process.env.PYAS_API_KEY })
// The first 30 minutes Avery and Sam are both free
const [slot] = await pyas.meetingTimes.find({
accountIds: [averyAccountId, samAccountId],
from: '2026-11-03T00:00:00Z',
to: '2026-11-07T00:00:00Z',
durationMinutes: 30,
})
// Book it on Avery's calendar, with a Meet link
const event = await pyas.events.create({
accountId: averyAccountId,
title: 'Intro call',
startsAt: slot.startsAt,
endsAt: slot.endsAt,
attendees: [{ email: 'sam@example.com' }],
conferencing: { provider: 'meet' },
})- Types from the API itself
- Generated from the OpenAPI document, so every parameter and field autocompletes, and a typo fails in your editor, not in production.
- Retries that are safe
- Rate limits and network failures are retried, Retry-After is honored, and an Idempotency-Key goes with every request that takes one.
- Pagination you don't write
- for await walks every page. await returns one page with its cursor.
- Errors that explain themselves
- NotFoundError, ConflictError, RateLimitError and the rest, each with the API's code, a hint, a docs link and the trace ID.
- Webhook verification
- constructWebhookEvent checks the signature and the timestamp, then hands you the typed delivery.
- No dependencies
- Node 20 or later and nothing else in your lockfile.
One method per operation
Every operation in the API reference has a method with a matching name, and each takes one object with its parameters. The same call works for a Gmail calendar and an Outlook one.
// Every event in November, page after page
for await (const event of pyas.events.list({ accountId, from: '2026-11-01T00:00:00Z', to: '2026-12-01T00:00:00Z' })) {
console.log(event.title, event.startsAt, event.timezone)
}
// Move one, refused if someone changed it in Outlook since you read it
const current = await pyas.events.get({ accountId, eventId })
await pyas.events.update(
{ accountId, eventId, startsAt: '2026-11-04T16:00:00Z', endsAt: '2026-11-04T16:30:00Z' },
{ ifMatch: current.version },
)The API from your terminal
Check an account, find a time, or find out why a request failed without writing a line of code. Every command takes --json, so your coding agent can run it too.
$ npx @pyas/cli login --key pyas_sk_test_...
$ npx @pyas/cli accounts status --needs-attention
$ npx @pyas/cli times --accounts acc_avery,acc_sam --duration 30
$ npx @pyas/cli logs get trc_9f2c41
$ npx @pyas/cli errors explain CONNECTION_NOT_FOUND
$ npx @pyas/cli webhooks listen --forward http://localhost:3000/webhooks- pyas accountsConnected accounts, and which ones need attention
- pyas eventsList, read, create and delete events
- pyas timesMeeting times when everyone is free
- pyas webhooks listenSandbox webhooks in your terminal, or forwarded to a local URL
- pyas logsWhat a request did and why it failed, or a live tail
- pyas errors explainAny error code's cause and fix
- pyas sandboxThe sandbox's people and IDs, or a reset
- pyas requestAny operation in the API reference, by its ID
Start from an app that works
One command creates an app with the SDK on the server, PyasConnect for connecting calendars, a webhook endpoint that checks signatures, a calendar page and a booking endpoint. Your test key goes into its env file, and it runs against your sandbox from the first start.
- nextjsNext.js App Router and ReactConnect with @pyas/connect-react
- nuxtNuxt and VueConnect with @pyas/connect-vue
- expressExpress 5 and TypeScriptConnect with the <pyas-connect> element
Each one includes an AGENTS.md, so Claude Code, Cursor or Codex know how the app is put together before they change it.
$ npx @pyas/cli init --template nextjs my-calendar-app
my-calendar-app/
├── app/api/pyas/connect-session/route.ts # PyasConnect's session endpoint
├── app/api/pyas/webhooks/route.ts # checks each delivery's signature
├── app/api/pyas/book/route.ts # books a meeting time
├── app/connect/page.tsx # the connect dialog
├── app/calendar/page.tsx # the user's calendar
├── lib/pyas.ts # the SDK client
└── AGENTS.md # how it fits togetherPython, PHP, Ruby and Go are planned
Until each one ships, any language calls the REST API directly. It is plain HTTPS and JSON, with one key in a header.
- An OpenAPI document describes every endpoint, for your own client generator.
- A Postman collection has every request ready to send.
- Every error carries a code, a hint and a trace ID, whatever language sent the request.
Questions
- Is there a Node.js SDK for Google Calendar and Outlook?
- @pyas/sdk is a TypeScript SDK for Node.js 20 and later that covers Google Calendar, Microsoft 365, Outlook.com and Zoom through one set of methods. It has no dependencies, and its types come from the Pyas OpenAPI document, so your editor completes every field.
- Which languages have a Pyas SDK?
- TypeScript and JavaScript on Node.js today. Python, PHP, Ruby and Go SDKs are planned. Until then, any language can call the REST API: an OpenAPI document describes every endpoint, and there is a Postman collection.
- Does the SDK retry failed requests?
- Yes, when it is safe to. It retries rate-limited requests and network failures, waits as long as the Retry-After header asks, and sends an Idempotency-Key with every request that takes one, so a retried create never makes two events.
- How do I page through every event?
- Use for await on a list method and the SDK fetches each page as you go. Await the method instead and you get a single page with its cursor.
- What does the pyas CLI do?
- It calls the API from your terminal: list accounts and events, create events, find meeting times, explain an error code, show what a request did by its trace ID, reset the sandbox, and forward sandbox webhooks to your laptop. pyas init creates a starter app with everything wired up. Every command takes --json, so coding agents can use it too.
- Can I use the SDK in Next.js or Cloudflare Workers?
- Yes. The PyasConnect session endpoint, pyas.connect.sessionHandler(), works as an Express or Node handler and as a route handler that returns a Response, for Next.js, Hono, Bun or Cloudflare Workers.