Configuring Event Schemas

This article helps the user understand what a user schema is and how to set it up

Updated over a week ago

An event schema is a means of describing the events that are generated in your software by your software so that Togai can listen in and digest the event streams that would be relevant for your billing needs. You would need to configure an event schema if you have usage based components or feature limits in your pricing model.

Let's take the example of Netflix :

For Netflix to be able to bill their customers based on usage, they would have to keep track of the number of movies watched and the duration of content consumed.

Here's what a config for Netflix would look like :

For this configuration, every time Netflix sends an event to Togai, they would have to send both the number of movies watched and the duration of content consumed watched. The events can be sent as realtime events or as a batched event.

Additionally, you can also add dimensions which are categorical variables or filter criteria that you can use to slice and dice the event streams. For example : if Netflix wants to offer a different pricing for content in different languages or different pricing for movies and TV shows, they can add the dimensions language and content_type to track the attributes (number of movies and duration of content) for each language and content type separately.

Once the schema is published, you can start sending event streams to Togai using the event ingestion APIs. Here are the APIs to ingest single events and batched events. Additionally, you can also ingest events manually for testing and that is covered in a subsequent section.

We're now all set on Togai to receive the event streams!

What's next? Let's convert the raw event streams into billable items

Did this answer your question?