Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
Pushing data from html input to separate API handling JS node

So I am making a webpage with a form which when submitted should post the user input to a Notion database. Both parts work separately, but I'm having a hard time finding information about how to get the API handling node and the HTML+CSS+JS site to communicate.

//API Handler
const dotenv = require('dotenv').config();
const {Client} = require('@notionhq/client');
const notion = new Client({ auth: process.env.NOTION_KEY });
database_id = process.env.NOTION_DATABASE_ID;

let createNewDayNotion = function(valsFromUser){...}

The webpage is very simple pure html+css+js and the calling action is an onmousemove="getUserInputData()"

Both parts work, the problem is that I don't understand how to use the function in the API node in the main web JS code. I understand that require does not work on client side, because if I try to implement the API code in the same VSCode workspace as the frontend it gives me require is not defined.

As you may notice, I'm a complete beginner to web site design and I'm really just looking for the easiest way for me to get the webpage and the node to communicate.

I was hoping to not really need a back end, since the page only communicates with the notion API, is this possible? Or is it just a confused question?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!