# @citation-js/plugin-doi

> Plugin for DOI input for Citation.js

Latest version **0.8.2** (published 2026-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @citation-js/plugin-doi
pnpm add @citation-js/plugin-doi
yarn add @citation-js/plugin-doi
bun add @citation-js/plugin-doi
```

## Health

**Score 60/100 (C)** — status: active.

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

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.8.2 |
| Published | 2026-07-13 |
| First published | 2018-12-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 1 |
| Unpacked size | 12.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 208 |
| Author | Lars Willighagen |
| Maintainers | larsgw |
| Keywords | citation-js, doi, crossref, datacite |

## Links

- npm: https://www.npmjs.com/package/@citation-js/plugin-doi
- Repository: https://github.com/citation-js/citation-js
- Homepage: https://citation.js.org/
- Issues: https://github.com/citation-js/citation-js/issues
- npm.io page: https://npm.io/package/@citation-js/plugin-doi

## Dependencies (1)

- [@citation-js/date](https://npm.io/package/@citation-js/date.md) ^0.5.0

## Recent versions

- 0.8.2 (latest) — 2026-07-13
- 0.8.1 — 2026-07-05
- 0.8.0 — 2026-07-05
- 0.7.21 — 2025-10-20
- 0.7.18 — 2025-01-28
- 0.7.16 — 2024-09-23
- 0.7.14 — 2024-06-12
- 0.7.13 — 2024-06-06
- 0.7.11 — 2024-04-17
- 0.7.9 — 2024-03-05
- 0.7.8 — 2024-01-22
- 0.7.7 — 2024-01-20
- 0.7.6 — 2024-01-17
- 0.7.2 — 2023-10-14
- 0.7.1 — 2023-09-23
- … 38 more at https://npm.io/package/@citation-js/plugin-doi/versions

## README

# @citation-js/plugin-doi
Plugin for DOI input for Citation.js.

[![NPM version](https://img.shields.io/npm/v/@citation-js/plugin-doi.svg)](https://npmjs.org/package/@citation-js/plugin-doi)
[![NPM total downloads](https://img.shields.io/npm/dt/@citation-js/plugin-doi.svg)](https://npmcharts.com/compare/@citation-js%2Fplugin-doi?minimal=true)
![License](https://img.shields.io/npm/l/@citation-js/plugin-doi.svg)
![Dependency status](https://img.shields.io/librariesio/release/npm/@citation-js/plugin-doi)
---

## Install

    npm install @citation-js/plugin-doi

## Usage

Register by importing the package:

```js
require('@citation-js/plugin-doi')
```

### 'Polite' API access

The plugin fetches data from DOIs using [DOI Content Negotiation](https://citation.crosscite.org/docs),
which means the Crossref, DataCite, and mEDRA APIs are indirectly used.

[Crossref strongly encourages](https://api.crossref.org/swagger-ui/index.html)
adding a `mailto:` link to the `User-Agent` header or URL parameters
to get higher rate limits. Because the Crossref API is only used indirectly,
the URL parameter method cannot be used consistently. Additionally, the `User-Agent`
header cannot be set in the browser. For non-browser usage however,
the user agent can be set like this:

```js
const { util, version } = require('@citation-js/core')

util.setUserAgent(`Example Foo (mailto:foo@example.org) Citation.js/${version} Node.js/${process.versions.node}`)
```

## Formats

Formats and other features added by this plugin.

### Input

Supports DOIs inputted in the following ways:

  * `@doi/api`: a `doi.org` URL
  * `@doi/id`: a single DOI
  * `@doi/list+text`: whitespace-separated list of DOIs
  * `@doi/list+object`: array of DOIs

Additionally, the following internal type is exposed:

  * `@doi/type`: fix the `type` value in certain API responses

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