Installation
Add go-notification to your Go project.
Requirements
- Go 1.22 or newer
- For the database channel: PostgreSQL, MySQL, or SQLite — connected via
database/sql.
Install
go get github.com/gopackx/go-notificationThat's the entire dependency — the core has no external SDKs. Drivers for specific providers live under subpackages and are pulled in only when you import them.
Import what you need
The root module path is github.com/gopackx/go-notification, and its package name is notification. You import the root package for the engine, then add only the driver subpackages you actually use — nothing is enabled by default, and there is no wildcard import.
import (
notification "github.com/gopackx/go-notification"
"github.com/gopackx/go-notification/channel/mail"
"github.com/gopackx/go-notification/channel/mail/mailgun"
"github.com/gopackx/go-notification/channel/whatsapp/waha"
)This keeps the binary small. If you never use Slack, the Slack driver isn't compiled in.
The named import (notification "github.com/...") is conventional because the
path ends in go-notification but the package is named notification. The
alias makes that explicit.
Verify
package main
import (
"fmt"
notification "github.com/gopackx/go-notification"
)
func main() {
notifier := notification.New(notification.Config{})
defer notifier.Close()
fmt.Println("go-notification ready:", notifier != nil)
}Run go run . — if it prints go-notification ready: true, you're done.
Next step
Continue with Quick Start to send your first notification.