Website = request info from database and dynamically replace text

How can I do something like:

fetch('https://website.com?token=XXX').then(function(response) {

to pull information from my mongoDB and update the text on a website with the response? Thanks in advance to all of you guys