Grpc before invoke script doesn’t recognize CryptoJS getting reference error not defined


We use HMAC authorization and to generate one we use CryptoJS function

I was able to execute the CryptoJS in REST API pre requisite script but I am getting error while executing the same CryptoJS function in Before Invoke script in grpc request

Could you please assist is it supported in Grpc Before invoke script ?

Thank you

Hey @kadayalan! :wave:

You’ll need to explicitly require the “crypto-js” module in your gRPC request’s script. Global modules are not supported in gRPC requests.

Sample usage:

const CryptoJS = require('crypto-js');

const MD5hash = CryptoJS.MD5('abc').toString();

console.log("MD5hash :: " + MD5hash);

Refer to the documentation here for more details.

Do let us know if you are still facing the issue after this!

Thank you so much it worked