# @particle/device-constants

> static device identifiers and meta-data for Particle hardware

Latest version **4.2.1** (published 2026-09-15) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @particle/device-constants
pnpm add @particle/device-constants
yarn add @particle/device-constants
bun add @particle/device-constants
```

## Health

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

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

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

## Facts

| | |
|---|---|
| Version | 4.2.1 |
| Published | 2026-09-15 |
| First published | 2021-10-14 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.x |
| Dependencies | 0 |
| Unpacked size | 31.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Particle Industries, inc |
| Maintainers | particlebot, no1089, carlos.hdez, guohui, keeramis5, monkbroc, mstan, sergeuz, avtolstoy, mlauer, wraithan, azenk, bwalach, rickkas7, mrlambchop_particle, hugo.montero, mphsi, pedrosordo, cole-abbeduto-particle, sbrust, eugene_particle, mohitparticle, karlag |

## Links

- npm: https://www.npmjs.com/package/@particle/device-constants
- npm.io page: https://npm.io/package/@particle/device-constants

## Recent versions

- 4.2.1 (latest) — 2026-09-15
- 4.0.0-0 (beta) — 2025-07-31
- 4.2.0 — 2026-09-15
- 4.1.1 — 2026-06-11
- 4.1.0 — 2025-08-15
- 4.0.2 — 2025-08-01
- 4.0.1 — 2025-07-31
- 4.0.0 — 2025-07-31
- 4.0.0-rc.2 — 2025-07-30
- 4.0.0-rc.1 — 2025-07-30
- 4.0.0-rc.0 — 2025-07-29
- 3.8.4 — 2025-03-22
- 3.8.3 — 2025-03-18
- 3.8.2 — 2025-03-08
- 3.8.1 — 2025-02-10
- … 38 more at https://npm.io/package/@particle/device-constants/versions

## README

# Particle Device Constants

The static device identifiers and meta-data for Particle hardware.

This project contains the constants as well as very lightweight wrappers around the constants and enables publishing
them as NPM modules and Ruby Gems. All languages' libraries follow the same versioning scheme.

![CI](https://github.com/particle-iot-inc/device-constants/actions/workflows/ci.yaml/badge.svg?branch=main)

[Installation](#installation) | [Development](#development) | [Releasing](#releasing)


## Installation

1. Install Node.js [`node@22.x` or later is recommended]
1. Clone this repository `$ git clone git@github.com:particle-iot-inc/device-constants.git && cd ./device-constants`
1. Install dependencies `$ npm install`
	* make sure you are signed into npm and a member of the `@particle` org ([docs](https://stackoverflow.com/c/particle/questions/184))
1. View available commands `$ npm run`
1. Run the tests `$ npm test`
1. Start Hacking!


## Development

The Device Constants repo contains static specs for official Particle platform devices and the tooling to support publishing a series of language-specific packages with that data. All essential commands are available via `npm run <script name>` - e.g. `npm run lint`. To view the available commands, run: `npm run`

<details id="develop-add-platform">
<summary><b>How to add a new platform</b></summary>
<p>

To add a new Particle platform device, simply:

1. Open the `src/constants.json` file in your favorite code editor
2. Add a new entry like:

```js
"example": {
	"id": <integer - the unique identifier>,
	"name": <string - the unique name used by Device OS' build system>,
	"displayName": <string - human-facing platform name>,
	"generation": <integer - e.g. `2` for photon, `3` for boron, `4` for p2>,
	"features": <array of strings - the features supported e.g. `wifi`, `ble`>,
	"billingConnectivity": <string for where data ops for this device type should be counted e.g. `wifi`, or `cellular``>,
	"public": <boolean - whether or not the platform is available to end-users>
},
```

_NOTE: See `src/constants.schema.json` for latest field definitions_

3. Validate your additions adhere to the current schema: `npm run validate`
4. Stage and commit: `git add -p && git commit`

</p>
</details>

<details id="develop-schema">
<summary><b>How to extend the device schema</b></summary>
<p>

Constants data must adhere to the JSON Schema (https://json-schema.org) specs in `src/constants.schema.json`. In some cases, you may need to extend the current schema to support addition properies, etc. To do that:

1. Read through the "[Getting Started](https://json-schema.org/learn/getting-started-step-by-step.html)" docs
2. Open the `src/constants.schema.json` file in your favorite code editor
3. Update the schema with your additions or changes - in some cases, you can jumpstart the process using the online generator at: https://www.jsonschema.net but be sure to scrutinize what it provides as it's not always super-accurate :)
4. Validate your changes have not rendered existing data invalid: `npm run validate`
5. Stage and commit: `git add -p && git commit`

</p>
</details>

### Making changes to the ruby wrapper

See the `src/ruby/README.md` file for more info on the Ruby Gem wrapper.

## Releasing

Packages are only released from the `main` branch after peer review.

1. make sure you have the latest:
	* `$ git checkout main`
	* `$ git pull`
1. make sure tests pass
	* `$ npm test`
1. run the release command
	* `$ npm version <major | minor | patch>`
	* This will bump the version in `package.json`, prompt you to update the `CHANGELOG.md`, and make a "X.Y.Z" commit for you.
1. follow the on-screen instructions, wait for confirmation of success
1. push your tags:
	* `$ git push origin main --follow-tags`

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