Gathering detailed insights and metrics for universal-contact-notifier
Gathering detailed insights and metrics for universal-contact-notifier
Gathering detailed insights and metrics for universal-contact-notifier
Gathering detailed insights and metrics for universal-contact-notifier
A generic Node.js/TypeScript notifier library to send contact form submissions to Discord (and future channels) via Webhook.
npm install universal-contact-notifier
Typescript
Module System
Min. Node Version
Node Version
NPM Version
70.6
Supply Chain
98.8
Quality
77.7
Maintenance
100
Vulnerability
88
License
TypeScript (97.19%)
JavaScript (2.81%)
Total Downloads
241
Last Day
3
Last Week
6
Last Month
47
Last Year
241
NOASSERTION License
20 Commits
1 Branches
1 Contributors
Updated on Jun 08, 2025
Latest Version
1.0.6
Package Id
universal-contact-notifier@1.0.6
Unpacked Size
14.93 kB
Size
5.18 kB
File Count
19
NPM Version
10.8.2
Node Version
18.20.8
Published on
Jun 08, 2025
Cumulative downloads
Total Downloads
Last Day
0%
3
Compared to previous day
Last Week
-25%
6
Compared to previous week
Last Month
-75.8%
47
Compared to previous month
Last Year
0%
241
Compared to previous year
7
A generic Node.js/TypeScript notifier library to send “Contact Form” submissions to messaging channels.
v1.0.0 ships with Discord support; future adapters (Telegram, Slack, SMS, email, etc.) can be added under src/sender/
.
email
, message
title
, name
, date
, extraFields
(any key→value), color
, username
, avatarUrl
Created by Alberto Linde (https://albertolinde.com)
1npm install universal-contact-notifier 2# or 3yarn add universal-contact-notifier
https://discord.com/api/webhooks/...
)DISCORD_WEBHOOK_URL
.env.example
→ .env
, paste your Webhook URLDISCORD_WEBHOOK_URL
as an environment variable1# .env 2DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/123456789012345678/your-token
universal-contact-notifier/
├── package.json
├── tsconfig.json
├── .env.example
├── LICENSE
└── src/
├── colors.ts
├── types.ts
├── errors.ts
├── validation.ts
├── builder.ts
├── sender/
│ ├── index.ts
│ └── discord.ts
└── index.ts
sendContact(channel, options): Promise<void>
channel
: currently only 'discord'
options
: see ContactOptions
1interface ContactOptions { 2 email: string; // required 3 message: string; // required 4 title?: string; // optional embed title 5 name?: string; // optional 6 date?: string; // optional 7 extraFields?: Record<string,string>; // optional additional fields 8 color?: ColorName | string; // optional palette key (UPPERCASE) or HEX 9 username?: string; // optional webhook username override 10 avatarUrl?: string; // optional webhook avatar URL override 11}
DiscordContactError
on validation or network errors1import { sendContact, DiscordContactError, COLORS } from 'universal-contact-notifier'; 2 3async function main() { 4 try { 5 await sendContact('discord', { 6 email: 'user@example.com', 7 message: 'Hello world!', 8 title: '🚀 New Inquiry', 9 name: 'Alice', 10 date: '2025-06-08T14:30:00Z', 11 extraFields: { phone: '+1-555-1234' }, 12 color: 'PURPLE', // from COLORS: TEAL, RED, BLUE, GREEN, YELLOW, PURPLE, GRAY 13 username: 'Contact Bot', 14 avatarUrl: 'https://example.com/avatar.png' 15 }); 16 17 console.log('Notification sent!'); 18 } catch (err) { 19 if (err instanceof DiscordContactError) { 20 console.error('Notify failed:', err.message); 21 } else { 22 console.error('Unexpected error:', err); 23 } 24 } 25} 26 27main();
Missing/invalid DISCORD_WEBHOOK_URL
Ensure it begins with https://discord.com/api/webhooks/...
.
Validation errors
DiscordContactError
will explain missing email
or message
.
Network/Discord errors
Check embed size limits (fields ≤1024 chars, description ≤4096 chars).
Node version
Requires Node ≥18 for built-in fetch
.
This project is licensed under the MIT License. See LICENSE for details.
No vulnerabilities found.