Connectors are enabled when enabling transformations. After enabling Transformations, you will see a new dashboard section where you will be able to create new connectors.
To configure a connector, you need to provide the following details:
Type: Choose from a set of services that provide easy webhook integrations, or choose Custom to build your own integration. We currently support Slack, Discord, and many more services, listed below.
Description: Describe the integration to your customers.
Event Types: Specify which events are going to be supported out-of-the-box by the integration.
Transformation Code: This is the glue code that will turn incoming webhook events into useful payloads for your integration. For example, if you are building a connector that sends Slack messages
every time a new invoice is created, the transformation will read invoice.created events and return a payload that works for Slack, like:
webhook.payload={"text":`An invoice of $${webhook.payload.amount} has been created.`}
The transformation code needs to account for all event types you choose to support. You can define different behaviors for each event type by switching on the webhook.eventType field.
For example, this transformation will create a different message depending on if the event type is invoice.created or invoice.deleted:
/** * @paramwebhook the webhook object * @paramwebhook.method destination method. Allowed values: "POST", "PUT" * @paramwebhook.url current destination address * @paramwebhook.eventType current webhook Event Type * @paramwebhook.payload JSON payload * @paramwebhook.cancel whether to cancel dispatch of the given webhook */ functionhandler(webhook){ switch(webhook.eventType){ case"invoice.created": webhook.payload={ text:`${webhook.payload.name} created an invoice for $${webhook.payload.amount}` }; break; case"invoice.deleted": webhook.payload={ text:`${webhook.payload.name} deleted an invoice` }; break; } return webhook }
Your customers will be able to customize the transformation code and the event types they listen to. Your definition should act as a working starting point they can use.
The Slack built-in integration lets you send messages to Slack channels via webhooks. It shows a 'Connect to Slack' button that lets your users get a Slack incoming webhook URL using OAuth in a few clicks, without leaving your site.
The Discord built-in integration lets you send messages to Discord channels via webhooks. It shows a 'Connect to Discord' button that lets your users get a Discord incoming webhook URL using OAuth in a few clicks, without leaving your site.
The Hubspot integration lets you connect webhooks directly to the Hubspot API. It shows a 'Connect to Hubspot' button that lets your users get a Hubspot access token that can be used to connect to the Hubspot API.
The transformation code should set the webhook URL to the Hubspot API endpoint (depending on the object) and format the payload appropriately to create the object in Hubspot.
For example, if you send a user.created webhook, and want to write a connector that creates a contact in Hubspot, the transformation code could look like this:
functionhandler(webhook){ /** * Example payload is: * { * user: { * firstname: 'John', * lastname: 'Doe', * email: 'john.doe@example.com' * } * } */ webhook.url="https://api.hubapi.com/crm/v3/objects/contacts";// The method is already POST webhook.payload={ properties:{ email: webhook.payload.email, firstname: webhook.payload.user.firstname, lastname: webhook.payload.user.lastname, } }; return webhook }
The Windmill connector lets your users get a Windmill webhook URL in a few clicks from the App Portal. It supports Windmill Cloud as well as self-hosted Windmill instances.
Since Windmill webhooks support arbitrary payloads, it does not require any custom transformation code.
In case you don't find a built-in integration for the service you want to connect to, you can create a custom integration. You can provide your own integration name and icon, and write instructions for your users on how to use it.
If you have a request for a built-in integration not listed above, contact us.