Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ax1/a1-notify
Utils for notification events (sms, email, local beep...). Useful to send alarms.
https://github.com/ax1/a1-notify
Last synced: about 22 hours ago
JSON representation
Utils for notification events (sms, email, local beep...). Useful to send alarms.
- Host: GitHub
- URL: https://github.com/ax1/a1-notify
- Owner: ax1
- Created: 2019-09-16T17:45:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T08:26:16.000Z (5 months ago)
- Last Synced: 2024-12-14T05:13:01.393Z (about 2 months ago)
- Language: JavaScript
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# a1-notify
Use different techniques to notify an event (alarm, trigger).
Available methods: beep, email, web push notification, sms to phone, or desktop pop-up.
## Email special case
Tested from gmail to gmail and to outlook.
https://nodemailer.com/about/
https://support.google.com/accounts/answer/185833?hl=en
Steps:
- enable 2FA in the account
- create an app password (go to google account and type "app password" in the search bar)
- add env variables EMAIL_USER="[email protected]" EMAIL_APP_PW="asdadadad"## Usage
> Typescript is also available
No configuration required.
```javascript
import * as notify from 'a1-notify'
notify.beep()
```## API
- **beep()**: Beep sound in the current computer.
- **async post(url, message)**: Send an HTTP POST message.
- **async push(url, message, token?)**: Send a web push notification. Token is optional for restricted push messages.
- **async email(to, subject, message)**: Send an email message. process.env.EMAIL_USER and process.env.EMAIL_APP_PW must be set before sending. Message can be either text or html.
- **async sms(phone, message)**: Send an SMS (requires AWS account and whitelisted or arbitrary SMS must be selected in the AWS console).
- **async popup(title,message)**: Display a desktop GNOME popup notification.