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

**URL:** <https://community.postman.com/t/grpc-before-invoke-script-doesn-t-recognize-cryptojs-getting-reference-error-not-defined/40644>\
**Category:** Help Hub\
**Created:** [October 31, 2022, 7:07pm UTC](https://community.postman.com/t/grpc-before-invoke-script-doesn-t-recognize-cryptojs-getting-reference-error-not-defined/40644 "2022-10-31T19:07:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadayalan](https://avatars.discourse-cdn.com/v4/letter/k/fbc32d/32.png) [@kadayalan](https://community.postman.com/u/kadayalan)\
**Post date:** [October 31, 2022, 7:07pm UTC](https://community.postman.com/t/grpc-before-invoke-script-doesn-t-recognize-cryptojs-getting-reference-error-not-defined/40644/1 "2022-10-31T19:07:32Z")

</div>

Hi

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

---

<div class="post-metadata">

**Author:** ![appurva21](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/appurva21/32/34560_2.png) [@appurva21](https://community.postman.com/u/appurva21)\
**Post date:** [November 1, 2022, 11:29am UTC](https://community.postman.com/t/grpc-before-invoke-script-doesn-t-recognize-cryptojs-getting-reference-error-not-defined/40644/2 "2022-11-01T11:29:44Z")

</div>

Hey @kadayalan! 👋

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:

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

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

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

```

Refer to the [documentation](https://learning.postman.com/docs/sending-requests/grpc/postman-sandbox-api/#using-external-libraries) here for more details.

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

---

<div class="post-metadata">

**Author:** ![kadayalan](https://avatars.discourse-cdn.com/v4/letter/k/fbc32d/32.png) [@kadayalan](https://community.postman.com/u/kadayalan)\
**Post date:** [November 1, 2022, 4:06pm UTC](https://community.postman.com/t/grpc-before-invoke-script-doesn-t-recognize-cryptojs-getting-reference-error-not-defined/40644/3 "2022-11-01T16:06:57Z")

</div>

Thank you so much it worked
