# @veramo/mediation-manager

> Mediation Manager Plugin for Veramo

Latest version **7.0.2** (published 2026-09-23) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @veramo/mediation-manager
pnpm add @veramo/mediation-manager
yarn add @veramo/mediation-manager
bun add @veramo/mediation-manager
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 7.0.2 |
| Published | 2026-09-23 |
| First published | 2023-12-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 62.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 543 |
| Author | Radley Sidwell-Lewis <radley.lewis@gmail.com> |
| Maintainers | veramo-bot, mirceanis, uport-automation-bot, nickreynolds2 |
| Keywords | Veramo, mediation-manager, veramo-plugin |

## Links

- npm: https://www.npmjs.com/package/@veramo/mediation-manager
- Repository: https://github.com/decentralized-identity/veramo
- npm.io page: https://npm.io/package/@veramo/mediation-manager

## Dependencies (4)

- [uuid](https://npm.io/package/uuid.md) ^11.0.0
- [debug](https://npm.io/package/debug.md) ^4.3.4
- [@veramo/kv-store](https://npm.io/package/@veramo/kv-store.md) ^7.0.2
- [@veramo/core-types](https://npm.io/package/@veramo/core-types.md) ^7.0.2

## Recent versions

- 7.0.2 (latest) — 2026-09-23
- 7.0.1-next-20260923103806 (next) — 2026-09-23
- 5.6.1-unstable.36 (unstable) — 2024-01-22
- 7.0.1-next-20260922123307 — 2026-09-22
- 7.0.1-next-20260920153615 — 2026-09-20
- 7.0.1-next-20260919194445 — 2026-09-19
- 7.0.1-next-20260917080719 — 2026-09-17
- 7.0.1 — 2026-09-15
- 7.0.1-next-20260915121021 — 2026-09-15
- 7.0.0 — 2026-02-11
- 6.0.3-next.65 — 2026-02-11
- 6.0.3-next.64 — 2026-02-10
- 6.0.3-next.63 — 2026-01-24
- 6.0.3-next.62 — 2026-01-24
- 6.0.3-next.61 — 2026-01-23
- … 65 more at https://npm.io/package/@veramo/mediation-manager/versions

## README

# Veramo: Mediation Manager Plugin

A plugin for the Veramo agent for integration with the DIDComm plugin when implementing mediation to the [Cooordinate Mediation V3 Specification](https://didcomm.org/coordinate-mediation/3.0/).  

## Overview

The Mediation Manager plugin enables the Coordinate Mediation V3 Specification in the `did-comm` plugin. There are three distinct stores which represent the three phases of mediation setup as well as a global policy of how requests for mediation should be dealt with. 

0. **Mediation Grant Policy**

By default, the `isMediateGrantAll` policy is set to `true` meaning that any requests for mediation will be `GRANTED` unless their `did` is listed in the `preRequestPolicyStore` as `ALLOW`. Conversely, if the `isMediateGrantAll` policy is set to `false`, all requests will be allowed, unless they are listed in the `preRequestPolicyStore` as `ALLOW`.

1. **Pre-Mediation Policy Store**

This store includes RequesterDid's as a key and stores an associated policy of `ALLOW` or `DENY`.

2. **Mediation Response Store**

Any request for mediation results in either a `GRANTED` or `DENIED` outcome. This is recorded in the `MediationResponseStore` with the `key=requester-did` and the value of `GRANTED` or `DENIED`.

3. **Recipient DID Store**

Finally, once a requester has been granted mediation, they need to inform the mediator of any dids in use (including their requester did or in other words the did they used to request mediation) by using the update recipient did message type.

**CLI Mediate**

For the purpose of managing `ALLOW` or `DENY` pre-mediation policies, as well as listing responses to mediation requests, a cli tool for mediation is available. See:

```bash
veramo mediate -h
```

## Configuration

The Mediation Manager Plugin can be used via the `agent.yml` or programatically injected in to the DIDComm plugin. 

## example agent.yml configuration

`agent.yml` example configuration for the `mediationManager` plugin below:

#### Step 1. Update the `dbConnection` in your `agent.yml`

> NOTE! this is required to include the kv-store migrations and entities so that the stores required by the mediationManager (in the next step) are available.

```yml
# Database

dbConnection:
  $require: typeorm#DataSource
  $args:
    - type: sqlite
      database:
        $ref: /constants/databaseFile
      synchronize: false
      migrationsRun: true
      migrations:
        $require: '@veramo/data-store?t=function#migrationConcat'
        $args:
          - $require: '@veramo/data-store?t=object#migrations'
          - $require: '@veramo/kv-store?t=object#kvStoreMigrations'
      logging: false
      entities:
        $require: '@veramo/data-store?t=function#entitiesConcat'
        $args:
          - $require: '@veramo/data-store?t=object#Entities'
          - $require: '@veramo/kv-store?t=object#Entities'
```

#### Step 2. Configure your Mediation Manager Plugin

> NOTE! each store MUST have a unique namespace so as to prevent conflicts. Each stage of the mediation setup has its own accompanying store.  

```yml
# Mediation Manager plugin

mediationManager:
  $require: '@veramo/mediation-manager#MediationManagerPlugin'
  $args:
    - isDefaultMediateGrantAll: true
    - policyStore: 
      $require: '@veramo/kv-store#KeyValueStore'
      $args:
          - namespace: 'mediation_policy'
            store:
              $require: '@veramo/kv-store#KeyValueTypeORMStoreAdapter'
              $args:
              - options:
                dbConnection:
                  $ref: /dbConnection
    - mediationStore:
      $require: '@veramo/kv-store#KeyValueStore'
      $args:
          - namespace: 'mediation'
            store:
              $require: '@veramo/kv-store#KeyValueTypeORMStoreAdapter'
              $args:
              - options:
                dbConnection:
                  $ref: /dbConnection
    - recipientDidStore:
      $require: '@veramo/kv-store#KeyValueStore'
      $args:
          - namespace: 'recipient_did'
            store:
              $require: '@veramo/kv-store#KeyValueTypeORMStoreAdapter'
              $args:
              - options:
                dbConnection:
                  $ref: /dbConnection
```

#### Step 3. Include the `mediationManager` above in your agent's plugins

```yml
# Agent

agent:
  $require: '@veramo/core#Agent'
  $args:
    - schemaValidation: false
      plugins:
        - $ref: /keyManager
        - $ref: /didManager
        - $ref: /didResolver
        - $ref: /didDiscovery
        - $ref: /messageHandler
        - $ref: /mediationManager # <<<< include your mediationManager plugin here
        - $require: '@veramo/did-comm#DIDComm'
        - $require: '@veramo/credential-w3c#CredentialPlugin'
          $args:
            - issuers:
              - $ref: /CredentialProviderLD
              - $ref: /CredentialProviderJWT
        - $require: '@veramo/selective-disclosure#SelectiveDisclosure'
        - $require: '@veramo/data-store#DataStore'
          $args:
            - $ref: /dbConnection
        - $require: '@veramo/data-store#DataStoreORM'
          $args:
            - $ref: /dbConnection
```

## Example TypeScript Configuration

```typescript
import {
  KeyValueStore,
  KeyValueTypeORMStoreAdapter,
  Entities as KVStoreEntities,
  kvStoreMigrations,
} from '@veramo/kv-store'
import { DataSource } from 'typeorm'

const dbConnection = new DataSource({
  name: 'test',
  type: 'sqlite',
  database: ':memory:',
  synchronize: false,
  migrations: dataStoreMigrations.concat(kvStoreMigrations),
  migrationsRun: true,
  logging: false,
  entities: (KVStoreEntities as any).concat(DataStoreEntities),
})

const policyStore = new KeyValueStore<PreMediationRequestPolicy>({
  namespace: 'mediation_policy',
  store: new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'mediation_policy' }),
})
const mediationStore = new KeyValueStore<MediationResponse>({
  namespace: 'mediation_response',
  store: new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'mediation_response' }),
})

const recipientDidStore = new KeyValueStore<RequesterDid>({
  namespace: 'recipient_did',
  store: new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'recipient_did' }),
})

const isDefaultMediateGrantAll = true;
const mediationManager = new MediationManagerPlugin(
  isDefaultMediateGrantAll,
  policyStore,
  mediationStore,
  recipientDidStore
)

const agent = createAgent({
  plugins: [
    // other plugins go here
    mediationManager
  ],
})
```

---
_Source: https://npm.io/package/@veramo/mediation-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
