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

# Types

### Params Argument

**params** argument that you get in *process* function is an object that has the following structure:

| Key                  | Type                                                                                                                                                                            |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| request              | [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request)                                                                                                             |
| handleTag            | (payload: [CDNTagPayload](https://docs.edgetag.io/channels/webhook/types.md#cdntagpayload), user?: { userId?: `string`; dbId?: `number` }) => `void`                            |
| getUsersByEmail      | (email: `string`) => Promise<{ userId: `string`; dbId: `number` }\[] \| `null`>                                                                                                 |
| getUsersByCustomData | (key: `string`, value: `string`) => Promise<{ userId: `string`; dbId: `number` }\[] \| `null`>                                                                                  |
| getUserByUserId      | (userId: string) => Promise<{ dbId: `string`; user: [FullUser](https://docs.edgetag.io/channels/webhook/types.md#fulluser), customData: Record<`string`, `string`> } \| `null`> |
| saveUserCustomData   | (userId: string, key: string, value: string, dbId?: number) ⇒ Promise\<boolean>                                                                                                 |
| writeError           | (category: [ErrorCategory](https://docs.edgetag.io/channels/webhook/types.md#errorcategory), error: Error)=> void                                                               |
| logger               | { log: (...args: `unknown`\[]) => `void`, error: (...args: `unknown`\[]) => `void` }                                                                                            |
| secrets              | Record\<string,string>                                                                                                                                                          |

### ErrorCategory

`authorization` | `payload` | `setup` | `infrastructure` | `worker` | `other` | `no-action` | `audience` | `unknown`

### CDNTagPayload

| Key       | Description                                                                               | Type                                                                                                                     | Required |
| --------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------- |
| eventName | Event name                                                                                | `string`                                                                                                                 | Yes      |
| eventId   | Event ID that needs to be unique                                                          | `string`                                                                                                                 | Yes      |
| timestamp | Timestamp of the event                                                                    | `number`                                                                                                                 | Yes      |
| data      | Data that is sent with the event                                                          | Record<`string`, `unknown`}                                                                                              | No       |
| storage   | Storage can be used to pass consent data, see Shopify template                            | Record<`string`, `unknown`>                                                                                              | No       |
| providers | Providers that are allowed to receive this event. Example: { all: false, facebook: true } | Partial<{ all: `boolean` } & Record<`string`, Partial<({ all: `boolean` } & Record<`string`, `boolean`>) \| `boolean`>>> | No       |
| pageUrl   | URL of the page where the event happened                                                  | `string`                                                                                                                 | No       |
| pageTitle | Title of the page where the event happened                                                | `string`                                                                                                                 | No       |
| userAgent | User agent of the browser                                                                 | `string`                                                                                                                 | No       |

You can also add user information to CDNTagPayload, which is defined in [this list](https://docs.edgetag.io/implementation/browser/user-info/standard-keys.md). The only change is that you need to prefix it with user.\
\
For example: `userEmail`, `userFirstName`

### FullUser

| Key               | Description               | Type     | Required |
| ----------------- | ------------------------- | -------- | -------- |
| email             | User's email address      | `string` | Yes      |
| phone             | User's phone number       | `string` | No       |
| firstName         | User's first name         | `string` | No       |
| lastName          | User's last name          | `string` | No       |
| gender            | User's gender             | `string` | No       |
| dateOfBirth       | User's date of birth      | `string` | No       |
| country           | User's country            | `string` | No       |
| state             | User's state              | `string` | No       |
| city              | User's city               | `string` | No       |
| zip               | User's zip code           | `string` | No       |
| ip                | User's IP address         | `string` | No       |
| consent           | User's consent string     | `string` | No       |
| consentCategories | User's consent categories | `string` | No       |
| created\_at       | User creation timestamp   | `string` | No       |
| user\_id          | User's unique ID          | `string` | Yes      |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.edgetag.io/channels/webhook/types.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
