Objective: Provide suggestions on how to best use the crypto helper in your workflow and create tokens in a cleaner manner.
For a full guide on how to use the crypto helper, please consult this documentation
Cryptographic operations can be complex, as such workflows using the crypto helper may require extra thought before implementing. In addition, as can be seen in the docs above, generating a token can require 8 or more steps, which can make workflows quite lengthy. However, please see if the suggestions below may help with your use case.
Tips:
- Some of the object helper steps in our tutorial could be compressed even further into a script step; ie. adding key/value pairs and 'stringifying' could be done in a script step rather than the object helper steps shown here. Using scripts is a general method for compressing WFs.
- Note 1: Tray does not currently support importing libraries in script tests, however, we do have 3 built-in JS libraries - Lodash, Mout, and Moment. See this article for further details.
- Note 2: Tray does not create or maintain custom scripts for customers.
- Whether or not you compress the token generation process with scripts, it may be wise to make use of callable WFs and triggers for readability and modularity.
-
Depending on the application you are using as a text editor, sometimes there are hidden characters encoded in your text. This is common when copy/pasting text from a browser, an email, a word document, etc. When you paste that text into Tray, encoded characters may appear decoded in our debug logs even though you cannot see them in your pasted text. For example, this may happen with the new line character (/n). When an application decodes /n in a string of text, it creates a new line visually. These invisible characters can cause issues with the crypto helper.
To sanitize your text, you can paste your text editor Integration Development Environment (IDE) such as VSCode or Sublime. Then copy the text from your IDE and paste it into Tray.
Comments
0 comments
Please sign in to leave a comment.