Skip to main content

Zapier Integration

Havrish Herman

Havrish Herman

Software Engineer @ Webhouk

Hi, my name is Herman, I'm co-founder of Webhouk.

I'm going to tell you, how @ Webhouk we are eating our own dog food by using Webhouk and Zapier integration.

Webhouk + Zapier = ❤️#

Everybody loves Zapier, youtube is full of people praising it for what it is, so it makes a lot of sense to use it to showcase Webhouk capabilities.

Zapier has tons of integration, for this example I'm going to show how to send a Slack message to whenever new user sings up.

Zapier Webhouk#

Go to https://zapier.com/app/dashboard and choose "Webhooks by Zapier" on the left and "Slack" on the right:

Zapier Dashboard

Press "try it". Copy Webhook URL and head over to Webhouk Dashboard.

Create new Endpoint, paste the url you've just copied, add a meaningful description if you feel like and press "Submit":

Zapier Dashboard

Return to the Zapier and press "Continue". You'll be prompt with "Test trigger" view. Return to Webhouk and send test Message:

Zapier Dashboard

tip

Test Message must have similar structure to the Real Message you'll be sending. Helps you to avoid re-configuration later on

After you sent a message you can finally get back to zappier to "test trigger":

Zapier Dashboard

The rest of the Zapier-Slack integration is up to a reader. I want to take a second to talk about the rest of Webhouk integration.

yarn add webhouk

Put this piece of code wherever you are creating your new user:

import {API, Webhouk} from 'webhouk'
//...
const apiKey = process.env.API_KEY
const api = new API(apiKey)
//...
const name = "Elon"
await api.sendMessage({
channelId: ZAPPIER_CHANNEL_ID,
eventType: "user.signup",
data: {name},
})
tip

You can get channelId in a couple of ways: from UI in the dashboard, from endpoins query, or from SDK