Giter VIP home page Giter VIP logo

notion-heroku's Introduction

Welcome to notion-heroku ๐Ÿ‘‹

License: MIT Twitter: kevinjalbert

Heroku hosted application that performs Notion actions (i.e., new task, new note) based on voice requests via IFTTT Webhooks and Google Assistant.

Prerequisites

  1. Have a Notion account
  2. Have a Heroku account
  3. Have an IFTTT account (with Google Assistant service enabled)
  4. Have Specific Notion Template as described in this blog post Have a table for Notes and/or a table for Tasks (can be the same table)
  5. Your Notion Token
  6. URLs for the tables defined in 4.

Install

Note: The required environment variables mentioned in the below steps are outlined in kevinjalbert/alfred-notion's section on finding your Notion Token and finding your Notion URLs.

Environment Variables

  • NOTION_TOKEN = your Notion Token
  • NOTES_DATABASE_URL = the url to your notes database
  • TASKS_DATABASE_URL = the url to your tasks database (can be the same)
  • MAX_TITLE_LENGTH (optional) = the maximum length of the title before it gets truncated. If your title gets truncated, the full, untruncated title will first be added to the database row's page as a text block, so you won't lose any text. Defaults to 100 characters.

With Heroku Deploy Button

Deploy

  1. Use above deploy button to create/launch application on Heroku
  2. Navigate to application settings page (i.e., https://dashboard.heroku.com/apps/your-notion-heroku/settings) and set required environment variables.

Manually

  1. Clone the repository via git clone [email protected]:kevinjalbert/notion-heroku.git
  2. heroku create
  3. git push heroku master
  4. Set all required environment variables via heroku config:set xxxx=yyyy

Setting up IFTTT Actions

Click to view walkthrough (images)

This walkthrough demonstrates how to setup a IFTTT action to add a Notion Task.

The main difference is that the webhook URL is either /add_note or /add_task in Step 6.

Step 1 - Choose Trigger Service (Google Assistant)

Step 1

Step 2 - Choose Google Assistant Trigger

Step 2

Step 3 - Complete Google Assistant Trigger Fields

Step 3

Step 4 - Choose Action Service (Webhooks)

Step 4

Step 5 - Choose Webhooks Action

Step 5

Step 6 - Complete Webhook Action Fields

Step 6

Notes:

ThI haven't updated the above screenshots from @kevinjalbert's original versions. While I've made sure you can still use the ?title= parameter, you can also omit that if you send JSON in the request body.

If the JSON object is present, it will extract a "title" from that, and anything in the "body" property will be put into the database row's page. Any other properties you supply in this object will automatically map to other database properties if present, and if not return an error indicating which properties were not present.

This opens up opportunities to include information like the source of your note (e.g. Google Assistant, Email, etc) if you set up multiple IFTTT trigger sources, or to add any other contextual information you deem relevant.

Example

{
  "title": "<Row title>", // REQUIRED. The title of the database row you're creating
  "type": "Note"|"Task",  // Which of the databases you want it to go to
  "url": "<url>",         // The url of the database you want it to go to (overrides "type")
  "body": "<text>"        // Text block you want to create inside the row's page (Markdown supported)
}

Author

๐Ÿ‘ค Kevin Jalbert

Show your support

Give a โญ๏ธ if this project helped you!


This README was generated with โค๏ธ by readme-md-generator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.