New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@neurosity/notion

Package Overview
Dependencies
Maintainers
2
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neurosity/notion

Notion API Client by Neurosity

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
68
decreased by-48.87%
Maintainers
2
Weekly downloads
 
Created
Source

Notion Client API by Neurosity

  • Universal JavaScript support: Node/Browser/Electron
  • Firebase + Custom Metric Subscriber
  • Event-driven multi-client real-time architecture

This is a private (soon to be public) module published on npm. Ensure the npm user has access to the neurosity npm org before installing/publishing.

Getting started

npm install @neurosity/notion

Then import the module

ESM
import { Notion } from "@neurosity/notion";
Node
const { Notion } = require("@neurosity/notion");
Browser
<script type="module">
  import { Notion } from "./node_modules/notion/esm/notion.mjs";
</script>
<script nomodule src="./node_modules/notion/browser/notion.js">

Examples

Basic

Utilizes Firebase client for data transport.

const notion = new Notion({
  deviceId: "****",
  apiKey: "************"
});

Options:

interface IOptions {
  deviceId: string;
  apiKey?: string;
  metricsAllowed?: string[];
  websocket: IWebsocketClient;
}

Clients

Supported clients include

  • Firebase
  • (Custom Subscriber e.i. Websocket instance)

Clients should be classes with the following interface.

export interface IClient {
  actions: IActions;
  connect(callback?: Function): Promise<any>;
  disconnect(callback?: Function): Promise<any>;
  getInfo(): Promise<any>;
  metrics: IMetrics;
}

Skills

Skills are applications that can be written and deployed to a Notion device.

A Skill is an npm package with:

  • index.js
  • package.json

For example:

./index.js

import { createSkill } from "@neurosity/notion";
import { Drone } from "parrot-drone";

export const mySkill = createSkill((notion, context) => {
  const { credentials } = context;

  const drone = new Drone({
    credentials
  });

  notion.kinesis().subscribe(kinesis => {
    drone.setFlightParams(kinesis);
  });
});

./package.json

{
  "name": "mind-drone",
  "version": "1.0.0",
  "description": "Notion-powered drone control",
  "dependencies": {
    "@neurosity/notion": "^6.0.0",
    "parrot-drone": "*"
  },
  "engines": {
    "node": "10"
  },
  "private": true
}

Releases

Please use semver

$ npm version (major|minor|patch)
$ npm push origin master
$ npm publish

Examples

Requirements to run examples:

  • Create .env file in root directory
  • Add: DEVICE_ID=YOUR_DEVICE_ID

Browser

Builds browser examples and serves examples in the browser with ES modules.

npm run examples:browser

Go to: http://localhost:3000

Node

npm run examples:node

TODOs

  • Add error handling
  • Test Auth
  • Check for CORS
  • Security audit
  • Document how to get deviceId
  • Document how to get apiKey for firebase
  • Remove apiKey from examples
  • Publish to cdn

Keywords

FAQs

Package last updated on 22 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc