メインコンテンツにスキップ

gas-todoist

Todoist Client for Google Apps Script.

AI Summary

GAS Todoist

A client library that enables Google Apps Script to add tasks to Todoist via the Sync API.

Target Users

Intermediate Google Apps Script developers who want to automate workflows that integrate with Todoist.

Problems Solved

Using the Todoist API from Apps Script normally requires manual HTTP requests and authentication handling, which is cumbersome.

Tags

Main Features

1
Add tasks with a few lines of code

Register a task by simply calling Todoist.Client#addItem without dealing with raw HTTP requests or Sync API details.

2
Install via Library ID

Start using the library by entering the provided ID in the Apps Script library dialog—no code copy required.

3
Bundled TypeScript typings

Type definitions such as ItemAddArgs enable editor auto-completion and help prevent parameter mistakes.

Usage Examples

Add a task to Todoist

/**
 * Sample that adds a simple task to Todoist
 */
function addTaskSample() {
  // Todoist API token (get it from Settings > Developer)
  const TODOIST_TOKEN = 'YOUR_API_TOKEN';

  // Create the client provided by the library
  const todoist = new Todoist.Client(TODOIST_TOKEN);

  // Define the task you want to add
  const task = {
    content: 'Buy milk', // task title
  };

  // Add the task and receive the created item info
  const created = todoist.addItem(task);

  // Output the result to the log
  Logger.log(created);
}

Copy-paste the code above into your GAS project to add a "Buy milk" task to Todoist.