Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.js #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -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 || "";
Expand All @@ -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
})
Expand All @@ -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();
main();