npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

alexa-notifier

v1.0.0

Published

Speak, announce, notify, and set reminders on your Amazon Echo / Alexa devices — a small, modern, Promise-first, TypeScript notifier.

Readme

alexa-notifier

Speak, announce, notify, and set reminders on your Amazon Echo / Alexa devices — a small, modern, Promise-first TypeScript notifier with zero runtime dependencies.

It's the Alexa counterpart to google-home-notifier: the same ergonomic device() / devices() / notify() shape, so you get symmetric tools for both ecosystems.

  • 📦 Zero runtime dependencies — talks to Amazon's Alexa API directly with fetch.
  • 🧊 Tiny, focused surfacespeak · announce · notify · reminder · setDoNotDisturb · getDevices.
  • ⛓️ Promise-firstawait alexa.notify('…'). No callbacks.
  • 🟦 TypeScript, shipped as dual ESM + CJS with types.
  • 🔁 Multi-device fan-out — broadcast to many; one offline Echo never blocks the rest.
  • 🔐 Login once — works with your existing Amazon account (no skill/developer setup); session is cached and reused.

Install

npm install alexa-notifier

Quick start

import { AlexaNotifier } from 'alexa-notifier'

const alexa = new AlexaNotifier({ proxy: true }); // interactive login (handles MFA)
await alexa.connect();                            // prints a URL to open once; then cached
// (proxy login uses the optional `alexa-cookie2` package: `npm i alexa-cookie2`)

await alexa.device('Living Room').announce('Dinner is ready');
await alexa.device('Office').speak('Build finished ✅');
await alexa.device('Bedroom').reminder('Take meds', new Date(Date.now() + 3600_000));

After the first login, the auth state is saved to ~/.alexa-notifier/state.json and reused — subsequent runs connect silently.

Multiple devices

await alexa.devices(['Living Room', 'Kitchen']).announce('Leaving in 5 minutes');
// or every device on the account:
await alexa.all().announce('Good morning!');

// Multi-target calls resolve a per-device array (never throw on one offline speaker):
// [ { device: 'Living Room', result: 'ok' }, { device: 'Kitchen', error: '…' } ]

Discover devices

const list = await alexa.getDevices();
// → [ { name: 'Living Room', serialNumber: '…', deviceType: '…', online: true }, … ]

API

| Method | Description | | --- | --- | | new AlexaNotifier(options?) | See options below. | | connect() | Authenticate (reusing saved state) + load devices. Idempotent; called automatically. | | getDevices() | Promise<DeviceInfo[]> — every device on the account. | | device(name) / devices(names) / all() | Choose targets. Chainable. | | speak(text) | Plain TTS (no chime). | | announce(text) | Amazon "Announcement" (chime + speech). | | notify(text) | Alias of announce — the headline verb. | | reminder(text, when?) | Create a reminder (when defaults to +1 min). | | setDoNotDisturb(enabled) | Toggle DND on the target device(s). |

Single-target calls resolve a status string and reject on failure. Multi-target calls (devices()/all()) resolve a DeviceResult[] and never reject because of one device.

Options

| Option | Description | | --- | --- | | cookie | A cookie string, or a saved registration object — skips login entirely (zero-dep path). | | proxy | true or { host, port } — interactive login (handles 2FA). Needs the optional alexa-cookie2 package. | | statePath | Where to persist the session (default ~/.alexa-notifier/state.json; false to disable). | | amazonPage | Amazon domain, e.g. amazon.com (default), amazon.de. | | alexaServiceHost | API host override. Default alexa.<amazonPage>. | | language | Locale for TTS/announcement payloads + Accept-Language. Default en-US. | | onProxyUrl | Callback invoked with the proxy login URL when interactive sign-in is needed. | | fetch | Inject a fetch implementation (defaults to global fetch). |

Notes & gotchas

  • Do Not Disturb silences announcements. If a call returns ok but you hear nothing, the device almost certainly has DND on — Amazon accepts the command, it just won't play. Toggle it directly:
    await alexa.device('Bedroom').setDoNotDisturb(false)
    await alexa.device('Bedroom').announce('You can hear me now')
    await alexa.device('Bedroom').setDoNotDisturb(true)
  • First login: use the proxy flow on a desktop browser (a phone may deep-link into the Alexa app), and open the exact http://<ip>:<port> URL it prints — it must match proxy.host. After that, the saved session is reused.

Dependencies & how it works

The published package has zero runtime dependencies — it calls Amazon's Alexa endpoints directly (/api/devices-v2/device, /api/behaviors/preview, /api/notifications, /api/dnd/status) with fetch, using a session cookie.

The only hard part of Alexa automation is login + token refresh, which is exactly why this library makes it optional: pass a cookie/saved session and it works dependency-free, or install alexa-cookie2 to enable the interactive proxy login. The actual functionality is its own small, self-contained code — not a wrapper around a larger client.

License

MIT © Noel Portugal