Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

247
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda