# @did-connect/handler

> Abstract handler for did-connect relay server

Latest version **2.2.8** (published 2025-05-12) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @did-connect/handler
pnpm add @did-connect/handler
yarn add @did-connect/handler
bun add @did-connect/handler
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.2.8 |
| Published | 2025-05-12 |
| First published | 2022-07-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 13 |
| Unpacked size | 32.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | wangshijun |
| Maintainers | wangshijun |
| Keywords | did, web3 |

## Links

- npm: https://www.npmjs.com/package/@did-connect/handler
- Repository: https://github.com/ArcBlock/did-connect
- Issues: https://github.com/ArcBlock/did-connect/issues
- npm.io page: https://npm.io/package/@did-connect/handler

## Dependencies (13)

- [axios](https://npm.io/package/axios.md) ^1.7.9
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [semver](https://npm.io/package/semver.md) ^7.3.8
- [@ocap/util](https://npm.io/package/@ocap/util.md) ^1.20.8
- [p-wait-for](https://npm.io/package/p-wait-for.md) ^3.2.0
- [object-hash](https://npm.io/package/object-hash.md) ^3.0.0
- [@arcblock/ws](https://npm.io/package/@arcblock/ws.md) ^1.20.8
- [@arcblock/did](https://npm.io/package/@arcblock/did.md) ^1.20.8
- [@arcblock/jwt](https://npm.io/package/@arcblock/jwt.md) ^1.20.8
- [@ocap/mcrypto](https://npm.io/package/@ocap/mcrypto.md) ^1.20.8
- [@did-connect/types](https://npm.io/package/@did-connect/types.md) 2.2.8
- [@did-connect/storage](https://npm.io/package/@did-connect/storage.md) 2.2.8
- [@did-connect/authenticator](https://npm.io/package/@did-connect/authenticator.md) 2.2.8

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.2.8 (latest) — 2025-05-12
- 2.2.7 — 2025-01-25
- 2.2.6 — 2025-01-25
- 2.2.5 — 2025-01-24
- 2.2.4 — 2024-04-12
- 2.2.3 — 2024-04-09
- 2.2.2 — 2024-04-08
- 2.2.1 — 2023-11-07
- 2.2.0 — 2023-07-10
- 2.1.59 — 2023-05-23
- 2.1.58 — 2023-05-19
- 2.1.57 — 2023-05-16
- 2.1.54 — 2023-05-04
- 2.1.53 — 2023-04-27
- 2.1.52 — 2023-04-23
- … 66 more at https://npm.io/package/@did-connect/handler/versions

## README

[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![docs](https://img.shields.io/badge/powered%20by-arcblock-green.svg)](https://docs.arcblock.io)
[![Gitter](https://badges.gitter.im/ArcBlock/community.svg)](https://gitter.im/ArcBlock/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

## Overview

This package defines the core handlers of a DID Connect relay, the handlers fall into two categories:

- HTTP handlers
  - `handleSessionCreate`: create a new session and persist it to storage
  - `handleSessionRead`: read a session from storage
  - `handleSessionUpdate`: update a session in storage, updates are limited
  - `handleSessionDelete`: delete a session from storage
  - `handleClaimRequest`: verify DID Wallet and send DID Connect requests
  - `handleClaimResponse`: verify DID Wallet and parse DID Connect responses
- WebSocket handlers
  - `wsServer`: a WebSocket server that can be attached to a HTTP server and used to broadcast session change events to client

## Notice

This package is baked into Blocklet Service and DID Connect Relay blocklet, you should not use it directly in any application.

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