react-google-calendar-api
An api to manage your google calendar
Install
npm install --save react-google-calendar-api
Use
import ApiCalendar from 'react-google-calendar-api';
Create a file apiGoogleconfig.json in the root directory with your googleApi clientId and ApiKey.
https://console.developers.google.com/flows/enableapi?apiid=calendar.
{
"clientId": "<CLIENT_ID>",
"apiKey": "<API_KEY>",
"scope": "https://www.googleapis.com/auth/calendar",
"discoveryDocs": ["https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest"]
}
Setup
handleAuthClick:
public handleAuthClick(): void
handleSignOutClick:
public handleSignoutClick(): void
setCalendar:
public setCalendar(newCalendar: string): void
Manage Event
You need to be registered with handleAuthClick.
Create Event:
public createEvent(event: object, calendarId: string = this.calendar): any {
Create Event From Now:
public createEventFromNow({time, summary, description = ''}: any, calendarId: string = this.calendar): any
List All Upcoming Events:
public listUpcomingEvents(maxResults: number, calendarId: string = this.calendar): any
Utils
listenSign:
public listenSign(callback: any): void
onLoad:
public onLoad(callback: any): void