@qte/nest-google-calendar
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Nest Google Calendar API wrapper

Thin wrapper around Google Calendar API for Nest.

Installation

yarn add @qte/nest-google-calendar

Usage

// *.module.ts
import { Module } from '@nestjs/common'
import { GoogleCalendarModule } from '@qte/nest-google-calendar'

@Module({
  imports: [GoogleCalendarModule],
  // ...
})
export class AppModule {}
// *.service.ts
import { Injectable } from '@nestjs/common'
import { GoogleCalendarService } from '@qte/nest-google-calendar'

@Injectable()
export class MyService {
  constructor(private readonly googleCalendarService: GoogleCalendarService) {}

  async getEvents() {
    const events = await this.googleCalendarService.getEvents({
      timeMin: new Date('2023-01-01'), // Get all events that start after this date
      timeMax: new Date('2023-12-31'), // Get all events that start before this date
      access_token: '...', // Google OAuth2 access token
    })
    return events
  }
}

API Reference

The package uses the Google Calendar v3 API

Readme

Keywords

none

Package Sidebar

Install

npm i @qte/nest-google-calendar

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

9.82 kB

Total Files

9

Last publish

Collaborators

  • elvejohansson
  • anderssjo
  • rahlenjakob
  • noahqte