1.7.4 • Published 4 months ago
ntfy v1.7.4
ntfy

Send notifications over ntfy.sh.
Prerequisites
Installation
ℹ️ This is a hybrid CommonJS / ESM module.
Run yarn add ntfy
or npm i ntfy
.
Usage
Simple example
import {publish} from 'ntfy';
await publish({
message: 'This is an example message.',
topic: 'mytopic',
});
Advanced example
import {publish, MessagePriority} from 'ntfy';
await publish({
actions: [
{
clear: true,
extras: {
cmd: 'pic',
camera: 'front',
},
intent: 'io.heckel.ntfy.USER_ACTION',
label: 'Take picture',
type: 'broadcast',
},
{
body: '{"action": "close"}',
clear: false,
headers: {
Authorization: 'Bearer zAzsx1sk..',
},
label: 'Close door',
method: 'PUT',
type: 'http',
url: 'https://api.mygarage.lan',
},
{
clear: true,
label: 'Open portal',
type: 'view',
url: 'https://api.nest.com/',
},
],
authorization: {
password: 'my-password',
username: 'my-username',
},
clickURL: 'https://github.com/ffflorian/',
delay: '1m',
disableCache: true,
disableFirebase: true,
emailAddress: 'name@example.com',
iconURL: 'https://avatars.githubusercontent.com/ffflorian',
message: 'Remote access to device detected. Act right away.',
priority: MessagePriority.MAX,
server: 'https://ntfy.custom',
tags: ['warning', 'skull'],
title: 'Unauthorized access detected',
topic: 'mytopic',
});
Use a custom server without specifying it every time
import {NtfyClient} from 'ntfy';
const ntfyClient = new NtfyClient('https://ntfy.custom');
await ntfyClient.publish({ ... });
await ntfyClient.publish({ ... });
1.7.3
4 months ago
1.7.2
7 months ago
1.6.3
8 months ago
1.7.1
7 months ago
1.7.0
8 months ago
1.7.4
4 months ago
1.5.5
11 months ago
1.5.4
1 year ago
1.6.2
10 months ago
1.6.1
11 months ago
1.6.0
11 months ago
1.5.3
1 year ago
1.5.2
2 years ago
1.5.1
2 years ago
1.5.0
2 years ago
1.4.9
2 years ago
1.4.10
2 years ago
1.4.8
2 years ago
1.4.7
2 years ago
1.4.6
2 years ago
1.4.5
2 years ago
1.4.4
2 years ago
1.4.3
2 years ago
1.4.2
2 years ago
1.4.1
2 years ago
1.4.0
2 years ago
1.3.1
2 years ago
1.3.0
2 years ago
1.2.1
2 years ago
1.2.0
2 years ago
1.1.0
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago