How to process webhooks for moralis streams?

Hey guys,

I am deploying my parse server to heroku, however I can’t seem to understand how to listen for webhook requests. As per this thread: Using event-syncs in Moralis SDK v2 & Parse Server we are supposed to create a post route for each of our webhooks.

What exactly do we have to put inside the /webhooks/test file and how exactly do we process the information to store it in the database (if that’s what’s we have to do). Also, is it necessary to use the verify signature function?

Thanks!

UPDATE: So I found the Github repo for streams-beta(https://github.com/MoralisWeb3/streams-beta) where there’s a bit more info on processing webhooks.

It says I can use the Moralis.Streams.verifySignature function to verify the webhook. It also says I can use the following to parse event data:

const decodedLogs = Moralis.Streams.parsedLogs<MyEvent>({ webhook, tag });
decodedLogs[0]

However, where exactly in my parse server should I include this code?

I am deploying my parse server to heroku, however I can’t seem to understand how to listen for webhook requests

Your server/API listens to these requests (webhooks which are sent).

It says I can use the Moralis.Streams.verifySignature function to verify the webhook. It also says I can use the following to parse event data:

You can use these functions in the route handlers (like app.post('')) for your webhook URL(s). Moralis Streams API sends data to your API endpoints, then you verify or process this data however you like.

You can check out the Nest.js demo as well.

That verify signature function is to verify that the signature is valid. You verify that signature with the web3api key