Svix Blog
Published on

Upload Event Types using our new Github Action

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!

The key to providing an easy webhook integration experience for your users lies in your event types. The first thing your users are interested in seeing when integrating with you is what events you send and what information those events provide. You should consider event types (and their schemas) as part of your API. Hence, they need to be accurate and up to date.

The best way to keep your Svix event types up to date is to make the update a part of your CI/CD process. That way, their names and schemas are always in sync with the latest version of your code. We've created a new Github Action to let you do exactly that.

The new Upload Event Types to Svix Action lets you upload an OpenAPI spec to Svix to automatically create or update event types based on the webhooks section of your docs.

Usage

The action is available on the Github Marketplace.

Github Action in Marketplace

All you need to do is add this to your deployment Github workflow:

- name: Upload Event Types to Svix
  uses: svix/svix-event-type-import-action@v1.0.0
  with:
    openapi-file: 'path/to/your/openapi-spec.yml' # can be a .json too
    svix-api-key: ${{ secrets.SVIX_API_KEY }}

And that's it. Your event types will be continuously updated as you update your OpenAPI spec and run your CI/CD pipeline.

Behind the scenes, this action uses the event type import endpoint provided by Svix API.

To learn more about importing event types from your OpenAPI specification, check out 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.