I am using script type module to run api in client side using request but getting error as require is not defined? How can I make it run on browser(client side) with script type module script below is the api I am using:
const request = require('request');
const options = {
method: 'GET',
url: 'https://manga-scraper-for-mangakakalot-website.p.rapidapi.com/search',
qs: {keyword: 'memori', page: '1'},
headers: {
'X-RapidAPI-Host': 'manga-scraper-for-mangakakalot-website.p.rapidapi.com',
'X-RapidAPI-Key': 'xxxxx',
useQueryString: true
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});