> For the complete documentation index, see [llms.txt](https://riteshs4hu.gitbook.io/infosec-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://riteshs4hu.gitbook.io/infosec-notes/reconnaissance/active-reconnaissance-approach/projectdiscovery-tools/notify.md).

# Notify

**Notify** is a lightweight, high-performance notification utility by [ProjectDiscovery](https://projectdiscovery.io/). It is designed for security researchers, penetration testers, and automation workflows. Notify enables real-time alerts from tools like **Nuclei, Subfinder, Amass, and Chaos** to various messaging platforms.

***

### **Official Links**

* [GitHub Repository: Notify](https://github.com/projectdiscovery/notify)
* [ProjectDiscovery Platform](https://projectdiscovery.io/)

***

### **Why Use Notify?**

* **Real-time Alerts** – Get notifications on **Slack, Discord, Telegram, Email, Microsoft Teams, and more**.
* **Seamless Integration** – Works with tools like **Nuclei, Subfinder, and others**.
* **Customizable Notification Rules** – Filter and format messages based on specific requirements.
* **Lightweight and Efficient** – Designed for **low-latency** and **high-speed** notifications.
* **Self-Hosted or Cloud-Based** – Can be deployed on a personal server or cloud platform.

***

### **Installation & Setup**

To install Notify using **Go**, execute the following command:

```bash
go install -v github.com/projectdiscovery/notify/cmd/notify@latest
```

To make `notify` globally accessible:

```bash
sudo cp ~/go/bin/notify /usr/local/bin
```

Verify the installation by running:

```bash
notify -h
```

***

### **Configuration**

Notify requires a **provider configuration file**, which should be located at:

```bash
$HOME/.config/notify/provider-config.yaml
```

#### **Sample `provider-config.yaml` Configuration**

```yaml
slack:
  - id: "slack"
    slack_channel: "recon"
    slack_username: "test"
    slack_format: "{{data}}"
    slack_webhook_url: "https://hooks.slack.com/services/XXXXXX"

discord:
  - id: "subs"
    discord_channel: "subs"
    discord_username: "test"
    discord_format: "{{data}}"
    discord_webhook_url: "https://discord.com/api/webhooks/XXXXXXXX"

telegram:
  - id: "tel"
    telegram_api_key: "XXXXXXXXXXXX"
    telegram_chat_id: "XXXXXXXX"
    telegram_format: "{{data}}"
    telegram_parsemode: "Markdown"

smtp:
  - id: email
    smtp_server: mail.example.com
    smtp_username: test@example.com
    smtp_password: password
    from_address: from@email.com
    smtp_cc:
      - to@email.com
    smtp_format: "{{data}}"
    subject: "Email subject"
    smtp_html: false
    smtp_disable_starttls: false

custom:
  - id: webhook
    custom_webhook_url: http://host/api/webhook
    custom_method: GET
    custom_sprig: '{"text":"{{ .url }}"}'
    custom_headers:
      Content-Type: application/json
      X-Api-Key: XXXXX
```

***

### **Usage Examples**

To send a test notification using a custom configuration file:

```bash
notify -pc notify-config.yaml -data "Hello from Notify!"
```

Using the default configuration file (`~/.config/notify/provider-config.yaml`):

```bash
notify -data "Hello from Notify!"
```

***

### **Integration with Telegram**

To set up **Notify** with Telegram, follow these steps:

1. Open **Telegram** and search for **@BotFather**.
2. Start a chat and send:

   ```
   /start
   ```
3. Create a new bot by sending:

   ```
   /newbot
   ```
4. Provide a bot name, such as:

   ```
   MyNotifyBot
   ```
5. Upon creation, BotFather will provide an **API Token**:

   ```
   1234567890:ABCdefGHIjklMNO_pqrSTUvwxYZ
   ```
6. Obtain the **Chat ID** by visiting the following URL (replace `<API_TOKEN>` with the provided token):

   ```
   https://api.telegram.org/bot<API_TOKEN>/getUpdates
   ```

   Example:

   ```
   https://api.telegram.org/bot1234567890:ABCdefGHIjklMNO_pqrSTUvwxYZ/getUpdates
   ```
7. Send a message to your bot from Telegram.
8. Refresh the **getUpdates** URL and retrieve the **Chat ID** from the response:

   ```
   987654321
   ```
9. Create the Notify configuration file for Telegram:

   ```bash
   nano ~/.config/notify/provider-config.yaml
   ```
10. Add the following configuration:

```yaml
telegram:
  - id: "tel"
    telegram_api_key: "1234567890:ABCdefGHIjklMNO_pqrSTUvwxYZ"
    telegram_chat_id: "987654321"
    telegram_format: "{{data}}"
    telegram_parsemode: "Markdown" # Options: None/Markdown/MarkdownV2/HTML
```

11. Save and exit the file.
12. Test Telegram notifications by running:

```bash
notify -data "Test message from Notify"
```

If configured correctly, the bot will send a message to your Telegram chat.

***

### **Integrating Notify with Tools**

**Sending Nuclei Scan Results to Telegram**

```bash
nuclei -l targets.txt | notify
```

**Forwarding Chaos Subdomains to Telegram**

```bash
chaos -d example.com -key <API_KEY> | notify
```

**Sending Custom Messages to Telegram**

```bash
echo "This is a test message" | notify
```
