npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

notional

v0.1.3

Published

An unofficial Notion API for interacting with table data in NodeJS

Downloads

3

Readme

Notional

An unofficial Notion API for interacting with table data in NodeJS

Notional: Existing as or based on a suggestion, estimate, or theory -- Cambridge Dictionary


Basic Usage

Installation

npm i notional

yarn add notional

Getting setup

To use notional, you'll need both an API key and your user ID. To acquire these, follow these steps:

  • Using a browser (Google Chrome in this example), visit a Notion webpage and make sure you're logged in.
  • Open your developer tools and navigate to the Application tab.
  • Under Storage, click on Cookies and then click on cookies from https://www.notion.so.
  • Here you should find a cookie called token_v2. This value is your apiKey.
  • You should also see notion_user_id, which you will need as your userId.

Tables

Let's say we have a table in Notion to keep track of our video games:

Reading from the table

Nice. Let's connect to that table in our code using notional, and read from our table all of the PC games that we have in our collection:

import notional from 'notional';

// Let's just pretend that this is the URL of our table!
const TABLE_URL = 'https://www.notion.so/example/481ff7846d1a4f1c8f30e3a3911d9129';

const { table } = notional({
  apiKey: process.env.NOTION_API_KEY,
  userId: process.env.USER_ID,
});

async function readOutMyPCGames () {
  const videoGamesTable = await table(TABLE_URL);
  
  const pcGames = await videoGamesTable
    .where({ Platform: 'PC' })
    .get();

  console.log(pcGames);
}

If we were to run that readOutMyPCGames function, we'd end up with an output like so:

[
  {
    "Title": "Resident Evil 2",
    "Platform": "PC",
    "Genres": ["action", "horror", "shooter"],
    "Finished": true,
    "Date purchased": {
      "type": "date",
      "start_date": "2020-03-19"
    }
  },
  {
    "Title": "Fallout 4",
    "Platform": "PC",
    "Genres": ["action", "shooter"],
    "Finished": false,
    "Date purchased": {
      "type": "date",
      "start_date": "2019-10-22"
    }
  },
  {
    "Title": "Skyrim",
    "Platform": "PC",
    "Genres": ["adventure"],
    "Finished": false,
    "Date purchased": {
      "type": "date",
      "start_date": "2017-11-09"
    }
  }
]

Updating the table

I finished Super Mario Odyssey recently, but it looks like the table is out of date and says I haven't finished it! Let's correct that.

We can set up the videoGamesTable variable in the same way as before, and then all we have to do:

await videoGamesTable
  .where({ Title: 'Super Mario Odyssey' })
  .update({ Finished: true });

Inserting into the table

I've just bought the video game Dark Souls this exact second, let's add that to our table!

await videoGamesTable.insertRows([
  {
    "Title": "Dark Souls",
    "Platform": "Xbox 360",
    "Genres": ["action", "adventure"],
    "Finished": false,
    "Date purchased": (new Date()).toISOString(),
  }
])

Deleting from the table

I don't think I'm going to be playing any more Skyrim any time soon. In fact, let's just get rid of it and remove it from our table:

await videoGamesTable
  .where({ Title: 'Skyrim' })
  .delete();