Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-notion-contents

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-notion-contents - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

2

lib/index.d.ts

@@ -10,3 +10,3 @@ import { Option, NotionUser, NotionContent } from './types';

private userContent;
constructor(token: string, option?: Option);
constructor(token?: string, option?: Option);
private getUserContent;

@@ -13,0 +13,0 @@ getUser(): Promise<NotionUser>;

@@ -19,7 +19,4 @@ "use strict";

class Notion {
constructor(token, option = { prefix: '/', removeStyle: false }) {
constructor(token = null, option = { prefix: '/', removeStyle: false }) {
var _a;
if (!token) {
throw new Error('Token MUST be provided.');
}
this.token = token;

@@ -34,2 +31,5 @@ this.option = {

try {
if (this.token == null) {
throw new Error('You need to pass the token to get your user data.');
}
const response = yield request_1.default('loadUserContent', this.token);

@@ -36,0 +36,0 @@ const result = yield response.json();

@@ -24,3 +24,3 @@ "use strict";

`);
const buildHtml = (pageId, token, option) => __awaiter(void 0, void 0, void 0, function* () {
const buildHtml = (pageId, token = null, option) => __awaiter(void 0, void 0, void 0, function* () {
process.setMaxListeners(0);

@@ -31,4 +31,5 @@ try {

yield page.goto(`https://www.notion.so/${pageId.split('-').join('')}`);
const cookie = [{ name: 'token_v2', value: token }];
yield page.setCookie(...cookie);
if (token != null) {
yield page.setCookie({ name: 'token_v2', value: token });
}
yield page.waitForSelector('#notion-app');

@@ -35,0 +36,0 @@ yield page.waitFor(20000);

{
"name": "get-notion-contents",
"version": "2.2.0",
"version": "2.3.0",
"description": "Get contents from notion",

@@ -5,0 +5,0 @@ "keywords": [

@@ -14,3 +14,3 @@ # get-notion-contents

## ⚠️ Prerequisite
You need a token to use this package.
You need a token to use this package if you want to get private contents.
You can get it from [Notion.so](https://www.notion.so/) cookie. the key of it is `token_v2`.

@@ -17,0 +17,0 @@

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