https://github.com/lucasvillarinho/nofy
📬 NoFy is a versatile, zero-dependencies library for sending notifications to popular services
https://github.com/lucasvillarinho/nofy
discord email go golang message notification slack whatsapp
Last synced: 27 days ago
JSON representation
📬 NoFy is a versatile, zero-dependencies library for sending notifications to popular services
- Host: GitHub
- URL: https://github.com/lucasvillarinho/nofy
- Owner: lucasvillarinho
- License: mit
- Created: 2024-07-26T12:35:39.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-11-08T21:14:30.000Z (6 months ago)
- Last Synced: 2025-04-06T01:38:24.469Z (about 1 month ago)
- Topics: discord, email, go, golang, message, notification, slack, whatsapp
- Language: Go
- Homepage:
- Size: 214 KB
- Stars: 22
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# `📬 NoFy`
✨ `nofy` is a versatile, zero-dependencies library for sending notifications to popular services.
[](https://github.com/lucasvillarinho/nofy/blob/main/go.mod) [](https://goreportcard.com/report/github.com/lucasvillarinho/nofy) [](https://app.codacy.com/gh/lucasvillarinho/nofy/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [](https://codecov.io/github/lucasvillarinho/nofy)
[](https://github.com/sponsors/lucasvillarinho)
### 💫 Features
> [!WARNING]
>
>API is currently under development. Expect potential changes and unstable behavior.- **Zero Dependencies**: Lightweight with no external dependencies.
- **Multi-Service Support**: Send notifications to Slack, Discord, Resend, and more.
- **Bulk Messaging**: Send notifications to multiple repositories simultaneously.
- **Extensible**: Easily add more services or custom logic.### 📦 Installation
#### Install
```sh
go get -u github.com/lucasvillarinho/nofy
```#### Example
##### Slack
```go
// Create a new Slack messenger
slackMessenger, _ := slack.NewSlackMessenger(
// Set the Slack token to be used to send (required)
slack.WithToken("token"),
slack.WithMessage(
// Message to be sent to the slack channel (required)
// The message is a slice of maps, each map represents a block of the message
// In this case, we are sending a single block with a text section
slack.Message{
Channel: "channel",
Content: []map[string]any{
{
"type": "section",
"text": map[string]string{
"type": "mrkdwn",
"text": "Hello, World!",
},
},
},
}))// Create a new Nofy with the Slack messenger
nofy := nofy.NewWithMessengers(slackMessenger)// Send the message for all messengers
_ = nofy.SendAll(context.Background())
```### 💛 Support the author
[](https://github.com/sponsors/lucasvillarinho)
Enjoying the project? Consider [supporting](https://github.com/sponsors/lucasvillarinho) it to help me keep improving and adding new features!
### 📜 License
[](https://github.com/lucasvillarinho/nofy/blob/main/LICENSE)
This software is licensed under the [MIT](https://github.com/lucasvillarinho/nofy/blob/main/LICENSE)