Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

248
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda