npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hook.notifier

v1.0.12

Published

Hook.Notifier is a push notification inbox, it allows you to receive push notifications from webhooks.

Downloads

26

Readme

Receive push notifications from your app to your phone.

  • Lightweight ~8kB
  • No dependencies
  • Node & browser support

divider hook notifier

Installation

npm install --save hook.notifier

or

yarn add hook.notifier

Before your continue

Hook.Notifier is an online service that allow you to receive push notifications on your phone and on your browser from any sources that can handle code or webhooks. You'll need an account to continue.

Check Hook.Notifier official website

You can also check our Getting start guide to learn everything about Hook.Notifier.

Warning

We have made this library work on a nodeJS server as well as on a browser. Using it on a browser can be interesting and convenient, but you have to keep in mind that your identifiers will not be safe anymore and that you expose them publicly. If ever your credentials are stolen, don't panic, your Hook.Notifier account remains safe, note that you can reset them in your Hook.Notifier account.

Simple start

import HookNotifier from 'hook.notifier';

const hn = new HookNotifier({ 
  identifier: 1671532023880, // Replace with your identifier
  key: 'long-frost', // Replace with your key
});

hn.sendNotification({ 
  object: 'My first notification', 
  body: 'The body of my first notification.' 
});

divider hook notifier

Parameters

divider hook notifier

| Name | Type | Description | Default Value | | ---------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------- | | identifier | String | Required — This is your identifier you can find it in your Hook.Notifier account. | | | key | String | Required — This is your key you can find it in your Hook.Notifier account. | | | object | String | Required — The object of your notification. | | | body | String | Required — The content of your notification. | | | tags | String (separated by ",") | Separated by commas — Tags are splitted to be filtered and grouped in categories. | "general" | | color | String (#FFFFFF) | The color of your notification. | "#FFC107" | | redirectUrl | String (Url) | Link to follow on click on the notification. | | | image | String (Url) | Image to display inside the notification. | | | sendToTeam | Boolean | The notification is sent to your team. | false | | sound | Boolean | The notification have sound. | true | | innerData | JSON | Datas stored inside the notification. | | | preventData | Boolean | This can be use to prevent the save of all inner datas. | false |

HookNotifier constructor

HookNotifier settings parameters can be passed to the constructor to use these in each of your requests.

const hn = new HookNotifier({ 
  identifier: 1671532023880, // Replace with your identifier
  key: 'long-frost', // Replace with your key
  
  tags: 'newDefaultTag', 
  color: '#000000', 
  sendToTeam: true, 
  preventData: false, 
  sound: false,
});

Full exemple

hn.sendNotification({
  object: `You've sell something`,
  body: '143.00€ from [email protected]',
  tags: 'ecommerce,online sell', 
  color: '#0097a7', 
  sendToTeam: false, 
  preventData: false,
  sound: true,
  redirectUrl: 'https://myonlineecommerce.com/order/123456789',
  innerData: {
    customer: '[email protected]',
    items: [
      { name: 'item-1', price: '143.00€' }
    ]
  },
});