{"library":"particle-api-js","title":"Particle API JS","description":"JavaScript library for the Particle Cloud API, usable in Node.js (v16+) and browser environments. Current stable version is v12.0.2, released via npm. Actively maintained with releases every few months. Written in TypeScript with full type declarations. Covers all Particle IoT device interactions: authentication, device listing, variable/function access, event streaming, firmware management, and more. Differentiates from raw fetch/axios by wrapping the entire Particle REST API with typed request options and responses, handling authentication and pagination internally. Ships both ESM and UMD builds (CDN via jsDelivr). Major v12.0.0 was a TypeScript migration; v11.0.0 removed token list/delete APIs and query access_token support.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install particle-api-js"],"cli":null},"imports":["import Particle from 'particle-api-js'","import type { DeviceInfo } from 'particle-api-js'","import type { LoginResponse } from 'particle-api-js'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import Particle from 'particle-api-js';\nimport type { DeviceInfo, LoginResponse } from 'particle-api-js';\n\nconst particle = new Particle({ auth: process.env.PARTICLE_TOKEN ?? '' });\n\nasync function listDevices() {\n  try {\n    const response = await particle.listDevices();\n    console.log('Devices:', response.body);\n  } catch (error) {\n    console.error('Error:', error);\n  }\n}\n\nasync function loginAndCall() {\n  const loginResp = await particle.login({\n    username: process.env.EMAIL ?? '',\n    password: process.env.PASSWORD ?? ''\n  });\n  console.log('Token:', loginResp.body.access_token);\n  // Re-create client with new token\n  const particleAuthed = new Particle({ auth: loginResp.body.access_token });\n  const device = await particleAuthed.getDevice({ deviceId: 'abc123' });\n  console.log('Device name:', device.body.name);\n}\n\nlistDevices();","lang":"typescript","description":"Shows how to instantiate Particle client, authenticate via login, list devices, and fetch a single device with full TypeScript typing.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}