@contriwork/notifications
v0.1.0
Published
Multi-channel notification client (Pushover, Telegram, Slack, Discord, SMTP) with retry, rate limit, and quiet-hours support.
Maintainers
Readme
@contriwork/notifications (npm)
Node.js / TypeScript adapter for the ContriWork Notifications port. One API surface, three languages (Python / .NET / npm) — this package is the Node.js implementation.
Cross-language specification, contract, and release history live in the GitHub repository:
- Root README — ecosystem overview
CONTRACT.md— language-agnostic port specCHANGELOG.md
Sister packages: contriwork-notifications (PyPI), Contriwork.Notifications (NuGet).
Install
npm install @contriwork/notifications
# or: pnpm add @contriwork/notifications
# or: yarn add @contriwork/notificationsRequires Node.js ≥ 24. Dual-published ESM + CJS with bundled .d.ts / .d.cts type declarations. Published with npm provenance via GitHub Actions OIDC.
Quick start
import {
NotificationClient, Severity, SlackWebhookAdapter,
} from "@contriwork/notifications";
const client = new NotificationClient([
new SlackWebhookAdapter({ webhookUrl: "https://hooks.slack.com/..." }),
]);
const result = await client.send(Severity.Warn, {
title: "Build failed",
body: "See CI for details",
});
console.log(result.ok, result.attempts);For the full set of adapters (InMemoryAdapter, PushoverAdapter, TelegramAdapter, SlackWebhookAdapter, DiscordWebhookAdapter, SmtpAdapter) and the configuration knobs (NotificationConfig, RetryConfig, RateLimitPolicy, QuietHoursConfig), see CONTRACT.md.
Local development
pnpm install --frozen-lockfile
pnpm test
pnpm typecheck
pnpm lint
pnpm buildLicense
MIT — see LICENSE.
