# addcal

> Open-source web application utility for adding calendar events via certain platform API's (Google, etc.)

Latest version **2.0.3** (published 2019-02-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install addcal
pnpm add addcal
yarn add addcal
bun add addcal
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2019-02-03 |
| First published | 2018-12-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 193.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jeremy Daley |
| Maintainers | daleyjem |

## Links

- npm: https://www.npmjs.com/package/addcal
- Repository: https://github.com/daleyjem/addcal
- Homepage: https://github.com/daleyjem/addcal#readme
- Issues: https://github.com/daleyjem/addcal/issues
- npm.io page: https://npm.io/package/addcal

## Dependencies (1)

- [ics-browser-es](https://npm.io/package/ics-browser-es.md) git+https://github.com/daleyjem/ics.git

## Recent versions

- 2.0.3 (latest) — 2019-02-03
- 2.0.2 — 2019-01-23
- 2.0.1 — 2019-01-23
- 2.0.0 — 2019-01-23
- 1.0.2 — 2018-12-13
- 1.0.1 — 2018-12-13
- 1.0.0 — 2018-12-13

## README

# AddCal [![Build Status](https://travis-ci.org/daleyjem/addcal.svg?branch=master)](https://travis-ci.org/daleyjem/addcal)

Open-source web application utility for adding calendar events via certain platform API's (Google, etc.)

## Current API Support

- [Google Calendar API](https://developers.google.com/calendar/)

## Pre-requisites

* Platform-specific API access grants from consuming web apps, specified through configuration options (see below).

## Implementation Example

An example for Typescript...

```js
import AddCal, {EventParams, generators} from 'addcal';

export class AppComponent {
  private addCal:AddCal;

  public constructor(){
    this.addCal = new AddCal({
      google: {
        apiKey: '<YOUR_API_KEY>',
        clientKey: '<YOUR_CLIENT_ID>'
      }
    });
  }

  /**
   * Add event to an api service (google, etc.)
   */
  public click_addEvent(eventData, service /* 'google' */){
    const params = new EventParams({
    	summary: eventData.summary, // 'Event Summary'
		description: eventData.description, // 'Event description.'
		start: eventData.start, // new Date()
		duration: eventDate.duration, // 60 minutes
		url: eventData.url // 'http://www.google.com'
    });
  
    this.addCal.addEvent(service, params)
      .then(() => {
        console.log('The reminder was added!');
      })
      .catch((err) => {
        console.log('There was a problem adding the reminder');
      })
    ;
  }
  
  /**
   * Download an .ics file
   */
  public click_downloadEvent(eventData, type /* 'ical' */){
    const params = new EventParams({
    	summary: eventData.summary, // 'Event Summary'
		description: eventData.description, // 'Event description.'
		start: eventData.start, // new Date()
		duration: eventDate.duration, // 60 minutes
		url: eventData.url // 'http://www.google.com'
    });
  
    this.addCal.download(type, params); // Or use `generators.ICALENDAR` for 'type' param
  }
}

```

---
_Source: https://npm.io/package/addcal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
