Trying to send api post with the authorization

Hi I wrote the code to send a post api to my solution. However, there is an error saying base64.encode is not defined.

Is there any other code that i can encode the username and password?

import {fetch} from ‘wix-fetch’;

export function postCurrentPayment(amount){
let url = “http://localhost:53187/api/donation”;
let username = ‘1’;
let password = ‘2323232’;

let headers = {
‘Authorization’: 'Basic ’ + base64.encode(username + “:” + password)

let options = {
headers: headers

return fetch(url, options)
.then((httpResponse) => {
if (httpResponse.ok)
return httpResponse.json();
// Add code to check the response

The node.js backend does not support the base64 function. From the Wix Package Manager , you can install the crypto-js library which includes support for base64: