Skip to main content
Version: v2.x

Recipes

Introduction

This section contains recipes for common use cases of Event Triggers. Each recipe is a succinct, tested, and reusable piece of code that can be used to solve a common use case. However, these recipes are not exhaustive and you can use them as a starting point to build your own custom logic.

Moderate user content with ChatGPT

A common use case for integrating AI-powered bots into applications is to take care of mundane tasks like moderating user content. This can be done with specialized sentiment analysis tool or a general large language model like ChatGPT. This recipe shows how to use ChatGPT to moderate reviews submitted by users. We'll build a webhook that parses Event Trigger data, sends it to ChatGPT, and then performs operations on our data based on the results. Check it out!

Optimize a product's description for SEO

Enhancing the SEO quality of product descriptions is important for e-commerce platforms. This guide illustrates how to employ Hasura's Event Triggers to automatically invoke a webhook whenever a new product is added. The webhook interacts with the OpenAI ChatGPT API to improve the product's description for better SEO performance. By using this technique to optimize or check human entered content in this way, you can improve the quality of your content and reduce the amount of time spent on manual review. Check out this recipe here.

New user onboarding

This recipe shows how to use Hasura's Event Triggers to automatically send a welcome email to a new user when they sign up. We'll build a webhook that parses Event Trigger data, sends an email, and then performs operations on our data based on the results. Check it out!

Send a Notification when Order Status Changes

This recipe shows how to use Hasura's Event Triggers to automatically send a notification to a user when the status of their order changes. We'll build a webhook that parses Event Trigger data and sends a notification using data received in event. Check it out!