Does this work for you?
const CryptoJS = await import('https://cdn.skypack.dev/crypto-js');
const message = 'hello';
const secretKey = 'secret';
const hmac = CryptoJS.HmacSHA1(message, secretKey);
const hashHex = CryptoJS.enc.Hex.stringify(hmac);
return hashHex;