# @tinyhttp/cookie-signature

> HTTP cookie signing and unsigning

Latest version **2.1.2** (published 2026-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tinyhttp/cookie-signature
pnpm add @tinyhttp/cookie-signature
yarn add @tinyhttp/cookie-signature
bun add @tinyhttp/cookie-signature
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.2 |
| Published | 2026-08-10 |
| First published | 2020-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=14.13.1 |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2901 |
| Author | v1rtl |
| Maintainers | dropthebeatbro, v1rtl |
| Keywords | tinyhttp, node.js, web framework, web, backend, static, cookie |

## Links

- npm: https://www.npmjs.com/package/@tinyhttp/cookie-signature
- Repository: https://github.com/tinyhttp/tinyhttp
- Homepage: https://tinyhttp.v1rtl.site
- npm.io page: https://npm.io/package/@tinyhttp/cookie-signature

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.1.2 (latest) — 2026-08-10
- 0.1.11 (pnpm-temp) — 2020-08-17
- 2.1.1 — 2024-06-26
- 2.1.0 — 2023-05-23
- 2.0.7 — 2023-05-14
- 2.0.6 — 2023-01-11
- 2.0.5 — 2022-09-15
- 2.0.4 — 2022-06-05
- 2.0.3 — 2022-02-18
- 2.0.2 — 2021-09-23
- 2.0.1 — 2021-09-07
- 2.0.0 — 2021-08-22
- 1.3.0 — 2021-04-26
- 1.2.3 — 2021-04-14
- 1.2.2 — 2021-04-02
- … 43 more at https://npm.io/package/@tinyhttp/cookie-signature/versions

## README

# @tinyhttp/cookie-signature

[![npm (scoped)](https://img.shields.io/npm/v/@tinyhttp/cookie-signature?style=flat-square)](https://npmjs.com/package/@tinyhttp/cookie-signature) [![npm](https://img.shields.io/npm/dt/@tinyhttp/cookie-signature?style=flat-square)](https://npmjs.com/package/@tinyhttp/cookie-signature)

HTTP cookie signing and unsigning. A rewrite of [cookie-signature](https://github.com/tj/node-cookie-signature) module.

## Install

```sh
pnpm i @tinyhttp/cookie-signature
```

## API

```js
import { sign, unsign } from '@tinyhttp/cookie-signature'
```

### `sign(val, secret)`

Signd the given `val` with `secret`.

### `unsign(val, secret)`

Unsign and decode the given `val` with `secret`, returning `false` if the signature is invalid.

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