Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add query flag to insert evt type into payload #836

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

svix-andor
Copy link
Contributor

Some users use one endpoint to consume different kinds of event types. In these cases it can be useful to have a discriminant in the payload itself to determine the type of event being sent. This PR adds a flag which automates this.

The flag defaults to false (don't insert). If set, it checks if the payload is a JSON object. If not then there's nothing sensible to do. If it is, it checks if there's already a field with the name "event". If yes, nothing is done. If no, it creates a new field with this name and sets its value to the event type name.

@svix-andor svix-andor force-pushed the andor/insert-event-type-into-payload branch from 30a9f8b to 3c65795 Compare February 10, 2023 12:50
svix-gabriel
svix-gabriel previously approved these changes Feb 10, 2023
@svix-andor svix-andor force-pushed the andor/insert-event-type-into-payload branch from a2515e3 to a850c80 Compare February 20, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants