Registry / messaging / pushbullet

pushbullet

JSON →
library3.0.0jsnpmunverified

A Node.js module for the PushBullet REST API. Current stable version is 3.0.0. Originally supported callbacks and promises; v3 migrated to async/await only. It provides methods for pushing notes, links, files, managing devices, and accessing push history. Lightweight wrapper with minimal dependencies.

npm install pushbullet
INSTALL
IMPORT
SIG · PUSHBULLET
P
pushbullet
messagingjavascriptv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PushBullet
import PushBullet from 'pushbullet'
import { PushBullet } from 'pushbullet'
Default import is required; named import is incorrect for this package.
PushBullet
const PushBullet = require('pushbullet')
const { PushBullet } = require('pushbullet')
CommonJS require returns the constructor directly, not an object.
instance methods
const pb = new PushBullet(apiKey); await pb.devices();
PushBullet.devices()
Methods are instance methods; do not call them statically without an instance.

Shows ESM import, instance creation with environment variable, fetching user info and devices, and pushing a note.

import PushBullet from 'pushbullet'; const pusher = new PushBullet(process.env.PUSHBULLET_API_KEY ?? ''); async function main() { try { const me = await pusher.me(); console.log('User info:', me); const devices = await pusher.devices(); console.log('Devices:', devices); await pusher.note({}, 'Hello', 'Test push from Node.js'); console.log('Note pushed'); } catch (err) { console.error(err); } } main();
Debug
Known issues
breakingVersion 3 drops callback support and promises in favor of async/await only.
fix
Migrate to async/await or use util.callbackify() to wrap async functions.
affects: >=3.0.0
deprecatedThe method `deleteAllPushes()` still accepts a callback but returns a Promise when called without callback.
fix
Use async/await instead of callbacks.
affects: >=3.0.0
gotchaThe `deviceParams` parameter for push functions can be a string, number, or object. A bare email string (containing '@') targets that email, not a device.
fix
Use an explicit object `{ email: 'user@example.com' }` for clarity.
affects: *
gotchaThe API key must be provided as a string. If passed as undefined or null, the constructor may fail silently or throw an unexpected error.
fix
Always validate the API key exists and is a non-empty string.
affects: *
breakingThe response objects from version 2 (e.g., `devices()`) returned data directly; version 3 returns a response object that requires `.json()` call.
fix
Use `await pusher.devices()` and then `await response.json()` if raw response needed, or rely on built-in parsing.
affects: >=3.0.0
Errors
Common errors & fixes
TypeError: PushBullet is not a constructor
Using named import `{ PushBullet }` instead of default import.
fix
Use `import PushBullet from 'pushbullet'`.
Cannot read property 'devices' of undefined
Calling `PushBullet.devices()` statically instead of on an instance.
fix
Create an instance first: `const pb = new PushBullet(apiKey); await pb.devices();`
Error: Invalid API key
API key is missing, empty, or incorrect.
fix
Set `process.env.PUSHBULLET_API_KEY` with a valid key from Pushbullet settings.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
pushbullet — npm install pushbullet · libregistry