Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/ntfy/src/NtfyClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ export async function publish<T extends Config>(publishConfig: T): Promise<Respo
requestConfig.headers['X-Email'] = publishConfig.emailAddress;
}

if (publishConfig.markdown) {
requestConfig.headers['X-Markdown'] = publishConfig.markdown;
}

if (ConfigHasMessage(publishConfig) && publishConfig.fileURL) {
if (typeof publishConfig.fileURL === 'string') {
requestConfig.headers['X-Attach'] = publishConfig.fileURL;
Expand Down
14 changes: 14 additions & 0 deletions packages/ntfy/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,20 @@ export interface BaseConfig {
* deleted. **Only JPEG and PNG images are supported at this time**.
*/
iconURL?: string;
/**
* By default, messages sent to ntfy are rendered as plain text.
*
* You can format messages using Markdown 🤩. That means you can use bold text, italicized text, links, images, and more. Supported Markdown features (web app only for now):
* - Emphasis such as bold (**bold**), italics (*italics*)
* - Links ([some tool](https://ntfy.sh))
* - Images (![some image](https://bing.com/logo.png))
* - Code blocks (```code blocks```) and inline code (`inline code`)
* - Headings (# headings, ## headings, etc.)
* - Lists (- lists, 1. lists, etc.)
* - Blockquotes (> blockquotes)
* - Horizontal rules (---)
*/
markdown?: boolean;
/**
* All messages have a priority, which defines how urgently your phone notifies you. On Android, you can set custom
* notification sounds and vibration patterns on your phone to map to these priorities (see
Expand Down
Loading