Discord webhook to Ntfy compatability layer
  • JavaScript 98.4%
  • Dockerfile 1.6%
Find a file
2026-03-03 23:53:34 +00:00
media Initial commit 2025-01-09 22:13:12 -05:00
.dockerignore Initial commit 2025-01-09 22:13:12 -05:00
.env.example Initial commit 2025-01-09 22:13:12 -05:00
.gitignore Initial commit 2025-01-09 22:13:12 -05:00
Dockerfile Update Node.js to v24 2026-03-03 22:04:58 +00:00
embedutils.js Initial commit 2025-01-09 22:13:12 -05:00
index.js Implement images/thumbnails from embeds 2025-01-10 02:37:14 -05:00
LICENSE.md Initial commit 2025-01-09 22:13:12 -05:00
package-lock.json Update dependency dotenv to v17 2026-03-03 23:53:18 +00:00
package.json Update dependency dotenv to v17 2026-03-03 23:53:18 +00:00
README.md Fix weird formatting in README.md 2025-01-09 22:25:21 -05:00
renovate.json Add renovate.json 2026-03-03 20:58:53 +00:00

Ntfyhook

Ntfyhook is a proxy/compatibility layer between Discord webhooks and Ntfy. It allows users to replace a Discord webhook link with a Ntfyhook link, and it will automatically format the data, including embeds, to be compatible with Ntfy.

Features

  • Proxy requests from Discord webhooks to Ntfy
  • Automatically formats Discord webhook data, including embeds, to be compatible with Ntfy
  • Supports basic and bearer authentication to Ntfy

A webhook message on Discord

The same message on Ntfy

See the Example Request section for the request body of the example.

Usage

  1. Set the NTFY_ROOT_URL environment variable to the root URL of your Ntfy instance. Example: https://ntfy.example.com
  2. Replace your Discord webhook link with the Ntfyhook link in your application.

Environment Variables

  • NTFY_ROOT_URL: The root URL of your Ntfy instance.

Example

export NTFY_ROOT_URL=https://ntfy.example.com

Running the Server

npm install
node index.js

The server will start listening on port 3000.

API

POST /:topic/:credentials

Proxy a Discord webhook request to Ntfy.

Parameters

  • topic*: The topic to post the message to.
  • credentials*: The authentication credentials of your Ntfy instance (must start with "Bearer" or "Basic").

Query Parameters

  • overrides: A JSON object containing any overrides for the Ntfy message payload.

* required

Request Body

The request body should be a valid Discord webhook payload.

Response

  • 200 OK: The message was successfully sent to Ntfy.
  • 400 Bad Request: The request was invalid.
  • 500 Internal Server Error: An error occurred while sending the message to Ntfy. The error details from Ntfy will be forwarded back to you in the response.

Example Request

Here is an example request using curl:

curl -X POST https://your-ntfyhook-instance.com/topic/Bearer%20your_token \
-H "Content-Type: application/json" \
-d '{
  "content": "This is a test message",
  "username": "TestUser",
  "avatar_url": "https://example.com/avatar.png",
  "embeds": [
    {
      "title": "Embed Title",
      "description": "Embed Description",
      "url": "https://example.com",
      "author": {
        "name": "Author Name",
        "url": "https://author.example.com"
      },
      "fields": [
        {
          "name": "Field 1",
          "value": "Value 1"
        },
        {
          "name": "Field 2",
          "value": "Value 2"
        }
      ],
      "footer": {
        "text": "Footer Text"
      },
      "timestamp": "2023-10-01T12:34:56.789Z"
    }
  ]
}'

License

Copyright (C) 2025 rocord01
This project is licensed under the GNU AGPLv3 license. See LICENSE for details.