GitPedia

Paseto

PASETO (Platform-Agnostic SEcurity TOkens) for Node.js with no dependencies

From panva·Updated June 23, 2026·View on GitHub·
·Archived

> [!IMPORTANT] > This project is now archived. It may get revived when v5 and v6 protocol versions get released and their underlying crypto becomes readily available in Web Cryptography API implementations across JavaScript runtimes. The project is written primarily in JavaScript, distributed under the MIT License license, first published in 2019. Key topics include: decode, decrypt, encrypt, paseto, sign.

Latest release: v3.1.4
April 27, 2023View Changelog →

[!IMPORTANT]
This project is now archived. It may get revived when v5 and v6 protocol versions get released and their underlying crypto becomes readily available in Web Cryptography API implementations across JavaScript runtimes.

paseto

PASETO: <strong>P</strong>latform-<strong>A</strong>gnostic <strong>SE</strong>curity <strong>TO</strong>kens for Node.js with no dependencies.

Supported Library Versions

VersionSecurity Fixes 🔑Other Bug Fixes 🐞New Features ⭐
v3.xSecurity Policy

Implemented Protocol Versions

v1v2v3v4
local
public

Documentation

Usage

Installing paseto

console
npm install paseto

Usage

js
const paseto = require('paseto') // Generic (all versions) APIs const { decode } = paseto // PASETO Protocol Version v1 specific API const { V1 } = paseto // { sign, verify, encrypt, decrypt, generateKey } // PASETO Protocol Version v2 specific API const { V2 } = paseto // { sign, verify, generateKey } // PASETO Protocol Version v3 specific API const { V3 } = paseto // { sign, verify, encrypt, decrypt, generateKey } // PASETO Protocol Version v4 specific API const { V4 } = paseto // { sign, verify, generateKey } // errors utilized by paseto const { errors } = paseto

Producing tokens

js
const { V4: { sign } } = paseto (async () => { { const token = await sign({ sub: 'johndoe' }, privateKey) // v4.public.eyJzdWIiOiJqb2huZG9lIiwiaWF0IjoiMjAyMS0wOC0wM1QwNTozOTozNy42NzNaIn3AW3ri7P5HpdakJmZvhqssz7Wtzi2Rb3JafwKplLoCWuMkITYOo5KNNR5NMaeAR6ePZ3xWUcbO0R11YLb02awO } })()

Consuming tokens

js
const { V4: { verify } } = paseto (async () => { { const payload = await verify(token, publicKey) // { sub: 'johndoe', iat: '2019-07-01T15:22:47.982Z' } } })()

FAQ

Semver?

Yes. Everything that's either exported in the TypeScript definitions file or
documented is subject to
Semantic Versioning 2.0.0. The rest is to be considered
private API and is subject to change between any versions.

How do I use it outside of Node.js

It is only built for Node.js environment versions >=16.0.0

Contributors

Showing top 6 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from panva/paseto via the GitHub API.Last fetched: 6/25/2026