https://github.com/hookdeck/transformation-cryptojs
https://github.com/hookdeck/transformation-cryptojs
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hookdeck/transformation-cryptojs
- Owner: hookdeck
- License: mit
- Created: 2022-08-17T20:25:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-18T17:31:59.000Z (about 3 years ago)
- Last Synced: 2025-01-23T13:13:48.618Z (12 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Using Crypto-js (or any other vanilla js library) in Hookdeck
[slack-badge]: https://img.shields.io/badge/Slack-Hookdeck%20Developers-blue?logo=slack
[![slack-badge]](https://join.slack.com/t/hookdeckdevelopers/shared_invite/zt-yw7hlyzp-EQuO3QvdiBlH9Tz2KZg5MQ)
The Hookdeck transformation runtime does not expose the node.js standard library. One way to get around that limitation is to find a polyfill, a ponyfill or a library that implements the desired functionality and bundle it with webpack, then upload the resulting bundle to the transformation editor.
This repo shows how to do that with Crypto-js.
# How to get it working
1. Clone the repo
2. Run `npm install`
3. Run `npm run-script build`
4. Modify the handler to do what you need it to
5. Copy/paste the contents of the bundle in `dist/main.js` to your transformation
6. Run the transformation to test that it works
[video](https://www.loom.com/share/86c7e6beea5844c9af52624cd9226a88) here!