Reputation: 31
I have been using zapier on a paid plan for some time now with incredible results. But as a programmer, I have been trying to perform some advanced operations.
At this moment, I was wondering if it is possible to reference external libs or sdks like firebase or google spreadsheet APIs and use them inside a code (javascript) trigger or action. I need this to perform some verifications on an exiting code step I have.
Upvotes: 2
Views: 1767
Reputation: 5264
David here, from the Zapier Platform team.
As the other answer mentioned, we don't support npm module is code steps. There's documentation about that here. It notes that you can make HTTP requests in code steps, so if your firebase endpoints are straightforward (and can be done without the aid of an SDK), you can do them by hand.
If you need an SDK, you'll need to create a custom app. You can keep it private for your own use and it'll have all the same rights and features as public apps. There are a couple of options here.
The best option is the CLI , which builds your app as a node module. This way, you write the whole thing in code and can include whatever you'd like!
If that doesn't work for some reason, we also have v2 of the platform (CLI is v3) that doesn't officially support modules, but there's an unsupported workaround.
Let me know if you've got any other questions!
Upvotes: 2
Reputation: 8232
Your question sounds like you want to stay inside the confines of the Code By Zapier
step. The docs state this
Unfortunately you cannot require external libraries or install or import libraries commonly referred to as "npm modules". Only the standard node.js library and the fetch package are available in the Code app. fetch is already included in the namespace.
If you're willing to invest a few hours in learning the Zapier CLI you can write your very own app in Node.js and then use that. This has some other advantages. I just did that very thing with a simple Google timezone API call. The README on my git repo has all the links you need to the Zapier docs. The git repo might even serve as a template.
https://github.com/Rolias/timezone-zap-app
Upvotes: 1