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

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
72
decreased by-58.14%
Maintainers
2
Weekly downloads
 
Created
Source

Notion Client API by Neurosity

  • Universal JavaScript support: Node/Browser/Electron
  • Wifi/WebSocket/Offline & Cloud/Firebase/Online modes
  • 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

Cloud mode

Utilizes Firebase client for data transport.

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

Wifi mode

Utilizes WebSocket client for data transport.

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

Options:

interface IOptions {
  apiKey: string;
  autoConnect: boolean;
  cloud: boolean;
  deviceId: string;
}

Manually connect

const notion = new Notion({
  autoConnect: false
});

await notion.connect();

Clients

Supported clients include

  • Cloud
  • Wifi

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;
}

Releases

Please use semver

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

Examples

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
  • Code splitting
    • Cloud client should only be loaded if cloud mode is enabled
    • Wifi client should only be loaded on wifi mode
  • Document how to get deviceId
  • Document how to get apiKey for cloud mode
  • Remove apiKey from examples
  • Publish to cdn

Keywords

FAQs

Package last updated on 15 Jul 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