---
url: "https://vueda.dev/v3/reference/api/py/vueda.history.middleware/VuedaHistoryMiddleware.md"
title: "VuedaHistoryMiddleware"
---

# VuedaHistoryMiddleware

## Overview

Record stable request metadata on the pghistory context.

pghistory's own middleware records the acting user and the request path. VUEDA adds the request
method, which is what separates a create from an update or a delete when one action writes to
several tables, and the action kind ``request``, which separates a request from a task or a
command once the events are read back.

This decides what VUEDA records, not what the history API exposes.

## `get_context` {#get_context}

### Signature {#get_context-signature}

`get_context(self, request)`

#### Parameters {#get_context-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| self |  | yes |  |  |
| <span id="get_context-param-request">request</span> |  | yes |  |  |

### Source {#get_context-source}

`server/vueda/history/middleware.py:19`

## Source

`server/vueda/history/middleware.py:8`
