@qte/nest-google-calendar
v1.0.0
Published
Thin wrapper around Google Calendar API for Nest.
Downloads
3
Keywords
Readme
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