> For the complete documentation index, see [llms.txt](https://docs.famewall.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.famewall.io/webhook-integration.md).

# Webhook Integration

Webhooks automatically send real-time event updates happening on Famewall to your other tools & systems

For instance, if you have messaging systems like Slack, Discord which could integrate with APIs, you can use Famewall's webhooks to receive a notification whenever a customer submits you a testimonial

Select the "Automation" tab in the sidebar and click on the "Webhook" button

<figure><img src="/files/sqcHJJjBTvwiOx6KLTxT" alt=""><figcaption></figcaption></figure>

Enter the Webhook Endpoint URL where you'd like to receive all the webhook events. And then click on the checkboxes of the type of events.

Here are the Event Types:

1. testimonial\_collected: Triggered when a customer submits a text/video testimonial on the testimonial collection page (eg. when a customer sends a testimonial on [Famewall's collection page](https://page.famewall.io/famewall))
2. testimonial\_approved: Triggered when you approve a collected testimonial by clicking "Add to Wall" in Famewall dashboard

Here is the code in Javascript to receive the payload and verify that the incoming event is authentic as coming from Famewall

```
const crypto = require('crypto');

function verifyFamewallSignature(payload, receivedSignature) {
   
  const hmac = crypto.createHmac('sha256', WEBHOOK_SECRET_KEY);
  const calculatedSignature = hmac.update(payload, 'utf-8').digest('base64');

  const isValid = crypto.timingSafeEqual(
    Buffer.from(calculatedSignature, 'base64'),
    Buffer.from(receivedSignature, 'base64')
  );

  return isValid;
}

app.post('/webhook', function(req,res,next){
    // Verify the payload
    const isPayloadValid = verifyFamewallSignature(JSON.stringify(req.body), req.headers['x-webhook-signature']);

    if (isPayloadValid) {
      console.log('Payload is valid. Process the webhook.');
      //verification valid
      
    } else {
      console.log('Payload is not valid. Discard the webhook.');
      //verification invalid
    }
} )


```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.famewall.io/webhook-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
