# @solid/jose

> JSON Object Signing and Encryption

Latest version **0.7.0** (published 2025-12-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @solid/jose
pnpm add @solid/jose
yarn add @solid/jose
bun add @solid/jose
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.7.0 |
| Published | 2025-12-26 |
| First published | 2018-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 80.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | justinwb, kjetilk, joachimvh, jaxoncreed, inrupt_ci, nseydoux, megoth, michielbdejong, virginiabalseiro, timbl, bourgeoa, matthieubosquet, jeswr |

## Links

- npm: https://www.npmjs.com/package/@solid/jose
- Repository: https://github.com/solid/jose
- Homepage: https://github.com/solid/jose#README
- Issues: https://github.com/solid/jose/issues
- npm.io page: https://npm.io/package/@solid/jose

## Dependencies (3)

- [base64url](https://npm.io/package/base64url.md) ^3.0.1
- [isomorphic-webcrypto](https://npm.io/package/isomorphic-webcrypto.md) ^2.3.8
- [@sinonjs/text-encoding](https://npm.io/package/@sinonjs/text-encoding.md) ^0.7.2

## Recent versions

- 0.7.0 (latest) — 2025-12-26
- 0.7.0-9549bbea (main) — 2025-12-26
- 0.7.0-7a6b2448 (24-merge) — 2025-12-26
- 0.6.9-bbf6e32c — 2025-12-26
- 0.6.9-f9f2c5ac — 2025-12-17
- 0.6.9 — 2025-12-14
- 0.6.9-67d40882 — 2025-12-14
- 0.6.8 — 2022-09-04
- 0.6.6 — 2021-06-09
- 0.6.5 — 2021-01-27
- 0.6.4 — 2021-01-14
- 0.6.3 — 2020-11-30
- 0.6.2 — 2020-11-11
- 0.6.1 — 2020-10-26
- 0.6.0 — 2020-07-30
- … 2 more at https://npm.io/package/@solid/jose/versions

## README

# JSON Object Signing and Encryption (JOSE) _(@solid/jose)_

> Lightweight isomorphic JSON Object Signing and Encryption (JOSE) library for browser and Node.js

## Table of Contents

- [Security](#security)
- [Background](#background)
- [Install](#install)
- [Usage](#usage)
- [License](#license)

## Security

TBD

## Background

- Based on Webcrypto API
- Isomorphic (Node.js and Browser)

## Install

Requires Node.js 8+.

```
npm install @solid/jose
```

## Usage

### Building with Webpack

**Important:**
If you're using this library as a dependency and you plan to use Webpack, don't
forget to add the following lines to your `webpack.config.js` `externals:` 
section:

```js
  externals: {
    '@sinonjs/text-encoding': 'TextEncoder',
    'isomorphic-webcrypto': 'crypto'
  }
```

### In Node

```js
const { JWT } = require('@solid/jose')

const decoded = JWT.decode(data) // throws an error if invalid
```

### In Browser

If you `npm install @solid/jose` as a dependency, the Webpack'd minified bundle will be
available in the `dist/` directory as `jose.min.js`.

If you're actively developing/testing this lib, you can `npm run dist`, and the
bundle will be rebuilt.

To use in the browser, simply import the bundle in a `<script>` tag, and the lib
will be loaded into the `window.JOSE` global variable.

Example `test.html` file, to illustrate:

```html
<html>
<head>
  <script src="dist/jose.min.js"></script>
  <script>
    // You can now start using the library
    let jwt = new JOSE.JWT({
      header: { alg: 'HS256' },
      payload: { iss: 'https://forge.anvil.io' }
    })
  </script>
</head>
<body>
Sample usage of JOSE lib in a browser.
</body>
</html>
```

## Testing

### Nodejs

```bash
$ npm test
```

## License

[The MIT License](LICENSE.md)

Copyright (c) 2016 Anvil Research, Inc.
Copyright (c) 2017-2019 The Solid Project

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