---
id: "npm_access_token"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["secrets"]
langs: ["common"]
quality: 78
url: "http://registry.apicrafter.io/datatype/npm_access_token"
---

# npm access token (`npm_access_token`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Access token of the npm package registry in the format introduced in 2021: the prefix npm_ followed by 36 letters and digits, the last six of which are a Base62-encoded CRC32 checksum. Older npm tokens are bare UUIDs.

- Parent datatype: `access_token`
- Personal data (PII): no
- Categories: Secrets and credentials (passwords, keys, tokens) (secrets)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^npm_[A-Za-z0-9]{36}$
```

## Examples

- `npm_ExampleTokenExampleTokenExampleToken` — Constructed, non-functional value
- `npm_ExampleTokenExampleTokenExampl` (invalid example) — Too short

## Supported by tools

- `detectsecrets`
- `gitleaks`
- `semgrep`
- `trufflehog`

## Sources

- doc: <https://github.blog/changelog/2021-09-23-npm-has-a-new-access-token-format/>
- other: <https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml>

## Quality

Score 78/100. Missing: second example, mapping (Wikidata, Schema.org, ...), translation.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/npm_access_token.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/secrets/npm_access_token.yaml>
