Svix Blog
Published on

Introducing AI generated transformation templates

Authors
  • avatar
    Name
    Luciano Bianchi
    Twitter

Cover image

Svix is the enterprise ready webhooks sending service. With Svix, you can build a secure, reliable, and scalable webhook platform in minutes. Looking to send webhooks? Give it a try!

In case you're not already familiar with Svix transformations templates, they are a recently added Svix feature that provides a great way to connect your webhooks to popular external services like Slack, Discord, Teams, or any API you can imagine.

Transformation templates require you to write JavaScript code that transforms your webhook payloads into the format required by the external service you want to connect to. That can be a bit daunting, specially when starting from an empty slate. Generative AI can help us with that.

AI transformation generation

In the transformation template editor, we've added a new 'Generate with AI' button, that lets you prompt AI to write the transformation code for you.

AI transformation generation

AI Prompt

The generator already knows about your event types and, if you're using one of the pre-built integrations (like Slack or Teams), it will also know the external service's API.

For example, if you want to connect a payment.created event to Slack, the generator will understand the event's payload and will generate transformation code like this one:

function handler(webhook) {
  if (webhook.eventType === 'payment.created') {
    webhook.payload = {
      text: 'A new payment has been created!',
      attachments: [
        {
          color: '#36a64f',
          fields: [
            {
              title: 'Amount',
              value: webhook.payload.amount,
              short: true,
            },
            {
              title: 'Currency',
              value: webhook.payload.currency,
              short: true,
            },
            {
              title: 'User ID',
              value: webhook.payload.user_id,
              short: true,
            },
          ],
        },
      ],
    }
  }
  return webhook
}

This way, with only a few clicks, you can have a working connection between your webhook events and the external service of your choice. You can then change the generated code to fit your needs, but it should already be a great starting point.

Wrapping up

The new AI generation feature is available today for all Svix users. It's a great way to get started with transformation templates and to get a feel for how they work.

We hope you give it a try and we're looking forward to hearing your feedback!

For a more detailed explanation on how to create and set up transformation templates, please refer to our docs.


For more content like this, make sure to follow us on Twitter, Github, or RSS for the latest updates for the Svix webhook service, or join the discussion on our community Slack.