> ## Documentation Index
> Fetch the complete documentation index at: https://docs.micleo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hookdeck

> Monitor and troubleshoot all inbound webhooks.

With hookdeck recieve webhooks events in Local and monitor all events in production.

<Warning>Hookdeck is optional. You can directly call the Supabase Edge Function API. But Postgres is not able to call localhost URL directly (net.http\_post).</Warning>

## Create an account

<Note>[https://hookdeck.com/](https://hookdeck.com/)</Note>

## Create a source, connections and destinations

* Source : api
* Connections:
  * api-prod
  * api-staging
  * api-dev
* Destinations:
  * prod
  * staging
  * dev

<Frame>
  <img src="https://mintcdn.com/micleo/b-FBhFe5P7CqnoRG/images/hookdeck-1.png?fit=max&auto=format&n=b-FBhFe5P7CqnoRG&q=85&s=8a6ab7918bfbd0c921879fe101558f19" style={{ borderRadius: '0.5rem' }} width="3022" height="1534" data-path="images/hookdeck-1.png" />
</Frame>

### Destinations

#### Prod & Staging

Create a destination with the HTTP type, and add the Supabase Edge Functions Endpoint.

<Frame>
  <img width="300" src="https://mintcdn.com/micleo/b-FBhFe5P7CqnoRG/images/hookdeck-2.png?fit=max&auto=format&n=b-FBhFe5P7CqnoRG&q=85&s=52d581bb3def6143c4c9da828e18691f" style={{ borderRadius: '0.5rem' }} data-path="images/hookdeck-2.png" />
</Frame>

#### Dev (Local)

Create a destination with the CLI type, and add the path: /functions/v1/api.

<Frame>
  <img width="300" src="https://mintcdn.com/micleo/b-FBhFe5P7CqnoRG/images/hookdeck-3.webp?fit=max&auto=format&n=b-FBhFe5P7CqnoRG&q=85&s=50835449a65d8cd0ca1e755ec681038c" style={{ borderRadius: '0.5rem' }} data-path="images/hookdeck-3.webp" />
</Frame>

### Connection filter

#### Filter Schema - Headers & Query

Filter with the server name for each connection.

```json theme={null}
{
	"$or": [
		{
			"server": "prod"
		},
		{
			"server": {
				"$exist": false
			}
		}
	]
}
```

### Install Hookdeck CLI

<Note>[https://hookdeck.com/docs/cli#installation](https://hookdeck.com/docs/cli#installation)</Note>

### Hoodeck CLI Local Server

Hookdeck CLI lets you forward webhooks received on any connection to a local web server.

```
hookdeck login
hookdeck listen <port> <source-name?> <connection-query?>
```

<Note>[https://hookdeck.com/docs/cli#why-use-the-cli](https://hookdeck.com/docs/cli#why-use-the-cli)</Note>
