Introducing Zapier's CLI Tool: Deploy API Integrations Fast
Some of a developer's most powerful tools call the command line home. Source control like git and cloud services like Heroku are mainstays in an engineering workflow—and they're the tools we use daily to manage the code that runs Zapier.
So we got to thinking, shouldn't you be able to build Zapier integrations from the command line, too? Starting today, you can: Zapier's brand new CLI tool lets you ship code directly from the command line, so you can build integrations in a way that fits your workflow.
Since we launched our Developer Platform in 2012, thousands of people have built integrations on Zapier. Why? Because with that single integration, developers can connect an app to more than 750 complementary tools. More connections means more possibilities, and more staying-power in someone's workflow.
This CLI tool is a new, powerful way to plug into Zapier's ecosystem. You can write, test, and deploy your own Node JS apps directly from your machine. Collaborating on an integration is simple when you mix in a tool like GitHub.
And, as always, hosting an integration on our developer platform is free. We won't charge you an admission fee to join the club.
Want to see our CLI tool in action? Here's our CTO, Bryan Helmig, walking through the setup for a new integration:
Why use Zapier's new CLI? You can keep your favorite development tools, build an app for any audience, and bring your teammates along for the ride.
Keep Your Existing Development Workflow
Integrating with Zapier doesn’t need to change the way you work. The new CLI to Zapier's Developer Platform meets development teams where they already spend their time. We’re making it easier than ever for engineering teams to build on Zapier.
- Bring your Node libraries. Zapier CLI Apps are made entirely of Node JS code. Use whichever libraries from npm that you like. You can control every aspect of how Zapier interacts with your API, and our schema defines how authentication, Triggers, Actions, and Searches work.
- Run your tests before you deploy. We believe unit testing is the best way to ensure high-quality code. You can use Mocha or another Node testing framework to feel confident in the code you deploy to Zapier.
- Your app can live in source control. Every aspect of your integration—and every change you make—is written in code. That means you can track changes with Git or other source control, like you do on other projects.
- Version your app. You work in releases or sprints for the rest of your projects, why not do the same with your Zapier app? Turn your app updates into versions, then migrate some or all of your users to the latest version.
- Collaborate with teammates. You don’t need to go it alone with your Zapier integration. A CLI app can be owned by more than one Zapier account, with new members quickly added using the tool. That way, the whole team can deploy updates to your Zapier app.
The best way to get a feel for the CLI is to follow this tutorial on GitHub. (Make sure you create a free Zapier account first!)
Build For Yourself, Or Anybody
Zapier apps don’t have to be public. In fact, creating an app just for your company is a great alternative to handcrafted internal tools that require their own hosting, logins, and other infrastructure. We support audiences of all shapes and sizes: one person, a handful, or any of our 1.5 million users. Every public app spends some amount of time in each of these stages.
All Zapier apps—regardless of whether they’re coded in the CLI or crafted with the Web Builder—default to "private". That means the developers working on the app can use it in Zapier's user interface.
You're welcome to leave it that way—sometimes you just need a one-off solution for a personal project. But most apps will move on to the "invite-only" stage. At this point, anyone with a special invite link that you distribute, can use the app with their Zapier account.
The invite stage is useful for:
- Sharing your app with a friend
- Deploying your app to your entire company
- Getting initial feedback on your app before taking it public
Every app completes the invite-only stage before going public on Zapier. At that point, we work with your team to launch and market the new integration. Our app lifecycle documentation explains those steps in more detail.
Why Choose CLI Instead of Web Builder?
The Web Builder is ideal for once-in-a-while coders who want a more on-rails experience. But there are a few key ways that our CLI stands out for the every-day engineer.
If you're familiar with our Web Builder, these new features solve some of the old gotchas.
- Coding locally. As mentioned above, you build CLI Apps on your local machine—not on Zapier's website.
- Improved control over authentication flow. CLI Apps give you control over the API calls needed to set up authentication. This is particularly helpful if your API uses a slightly different flow for OAuth2 than what the Web Builder assumes. Now, you can determine the necessary calls and store whatever info your API needs.
- Improved Custom Fields. When setting input fields, you can define static fields as well as functions to compute fields dynamically. These dynamic fields can be the result of API calls, or they can be computed based on the value of a static field.
- Middleware. Tired of including a function call to add a header to each request? Or a call to parse out the responses? Now you can define middleware that runs before requests or after responses to process calls in a standard way.
- Resources. You can define a single resource like a “Contact” and the methods allowed on that resource—like “get, list, create.” From this resource definition, Zapier can automatically generate Triggers and Actions, reusing some of the meta information defined on the resource.
Rapid-Fire Questions
How much does it cost?
Connecting to the Zapier developer platform is completely free. We don't charge you to maintain your app privately, or to launch it publicly to all Zapier users.
What happens to my existing app? Do I need to upgrade to this new platform?
Nothing changes with your existing app. You can still update and manage it with our Web Builder, and you won't be required to move to the CLI. We're keeping both platforms as different paths that people can choose for their app development.
Can I make updates to my existing Web Builder app using the CLI?
No. Only apps that were built using the CLI tool can be updated from the command line. For general updates to apps that weren't built with the CLI, you'll need to use our Web Builder tool.
Can I convert my existing app?
Yes, but it will take some work. To get you started, the CLI has a convert
command that can generate some of the boilerplate needed to define a CLI App from an existing one built in the Web Builder.
From there, you’ll need to fill out the implementation for each Trigger, Action, and/or Search. Remember that apps built in the Web Builder rely on Zapier to make the actual HTTP requests, whereas CLI Apps give you the flexibility and responsibility to do them yourself.
If you’d like to explore the possibility of converting an app, contact us.
Where can I ask my technical questions?
If you have questions about setting up an app or launching it on Zapier, check out the Developer Platform documentation or contact our support team. They'll get you routed to the right person.
Don’t Limit Your Imagination
Our new CLI to the Zapier Developer Platform makes it easier than ever to integrate your app with the 750+ tools on Zapier. Outside of the basic definition of a Zapier app, you have a blank slate to dream up any way to connect your API or service. If you need to pull in your own helper libraries from npm or write advanced logic to post-process multiple API calls in a single function, it can be done. The CLI deploys your code to Zapier, and you decide what goes into that code. So, get started now for free.
Comments powered by Disqus