To use a 3rd party library, you’ll need to move your project from the UI tool to the Zapier CLI. From there you can import moment from npm, import it and use it.
Instructions on exporting a UI-based project and continuing work in the CLI: https://platform.zapier.com/docs/export
Key differences in capabilities between the (current) Platform UI tool and the CLI: https://platform.zapier.com/docs/vs
https://zapier.com/developer/documentation/v2/scripting/#available-libraries is actually documentation for the legacy Web Builder tool/platform. It’s a common source of confusion. As we’re about a month away from retiring the legacy tool, we’re looking forward to removing that section of content.
Got it, thanks! For the future, where is the documentation for the scripting capabilities usable in code mode in the Platform UI tool?
You’ll see discussion of “code mode” topics sprinkled throughout the docs for the Platform UI. https://platform.zapier.com/docs/zapier-intro
But the best definitive reference for writing code in the UI is actually the CLI docs. https://zapier.github.io/zapier-platform/
The cool thing about the modern Platform UI is that you’re building something that runs on the same platform as the CLI. You’re creating an app definition that follows the same schema as an integration created in the CLI. (Presently the UI is compatible with core version 9.x)
Not all features described in the CLI docs are available in, or relevant to, the UI. But the CLI docs are the best source to go deeper into writing JavaScript code to use the request API, customize response data, handle special errors, etc.
We’ll be reworking docs over the next couple months with an eye toward presenting the information in a more unified way that’s easier to navigate, no matter which tool you’re working in.