Skip to content

HeRoMo/gas-todoist

Repository files navigation

GAS Todoist

clasp

Todoist Client for Google Apps Script. Use Todoist Sync API. NOW, only add_item command is implemented.

Instalation

  1. Create or Open your GAS project.
  2. Cliock Add Library link, then Library daialog is opened. Input library-id
  3. Input 1EMZVgA58kI-yF2-mB8r14-dTk0D4cia9tRc9X2_lpiWO3IqRq6eWBg-S, and click Add button.
  4. Select library version.
  5. Change Identifier of this library to Todoist change Identifier
  6. Click Save button.

Usage

Get API Token TODOIST_TOKEN in https://todoist.com/app/settings/integrations/developer .

Some samples is below.

// create a single task.
function addSingleItem() {
  const task: Todoist.ItemAddArgs = {
    content: 'Single Item',
  };

  const todoist = new Todoist.Client(TODOIST_TOKEN);
  const addedItem = todoist.addItem(task);
}

// create a single task with a note.
function addItemWithNote() {
  const item: Todoist.ItemAddArgs = {
    content: 'Item with Note',
  };
  const note: Todoist.NoteAddArgs = {
    content: 'Note !',
  };

  const todoist = new Todoist.Client(TODOIST_TOKEN);
  const addedItem = todoist.addItem(item, note);
}

Requirements

  • Node.js
  • Yarn

How to setup your project

  1. Clone this ripository.
  2. Install dependencies by yarn install
  3. Create your GAS project, push code, and open web editor.
    $ yarn clasp:create --title gas-todoist --type standalone --rootDir src 
    $ yarn clasp:push
    $ yarn clasp:open

Related Documents

LICENSE

MIT