From 2223d9674c35f9cc9195747e9eb3f633fabb1b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Guiomar=20Niso=20Gal=C3=A1n?= Date: Wed, 19 Apr 2023 17:30:28 +0200 Subject: [PATCH] Update index.js Repalce `notion`by `neurosity` to be aligned with the web tutorial. Otherwise, you could update the web tutorial to match: https://docs.neurosity.co/docs/tutorials/your-first-node-app#add-dependencies-to-indexjs --- index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index dc356a4..f9797f8 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ -const { Notion } = require("@neurosity/notion"); +//const { Notion } = require("@neurosity/notion"); +const { Neurosity } = require("@neurosity/sdk"); require('dotenv').config(); const deviceId = process.env.DEVICE_ID || ""; @@ -17,12 +18,14 @@ const verifyEnvs = (email, password, deviceId) => { verifyEnvs(email, password, deviceId); console.log(`${email} attempting to authenticate with ${deviceId}`); -const notion = new Notion({ +//const notion = new Notion({ +const neurosity = new Neurosity({ deviceId }); const main = async () => { - await notion.login({ +// await notion.login({ + await neurosity.login({ email, password }) @@ -32,11 +35,12 @@ const main = async () => { }); console.log("Logged in"); - notion.calm().subscribe((calm) => { +// notion.calm().subscribe((calm) => { + neurosity.calm().subscribe((calm) => { if (calm.probability > 0.3) { console.log("Hello world"); } }); } -main(); \ No newline at end of file +main();